Шмуэль Б 1:1 Мидраш: Bereshit Rabbah & Sifrei Devarim

וַיְהִ֗י אַֽחֲרֵי֙ מ֣וֹת שָׁא֔וּל וְדָוִ֣ד שָׁ֔ב מֵהַכּ֖וֹת אֶת־הָעֲמָלֵ֑ק וַיֵּ֧שֶׁב דָּוִ֛ד בְּצִקְלָ֖ג יָמִ֥ים שְׁנָֽיִם׃

И было это после смерти Саула, когда Давид возвратился с бойни Амаликитян, и Давид провел два дня в Циклаге;

Bereshit Rabbah

“It was after the death of Abraham, God blessed Isaac his son, and Isaac lived beside Be’er Laḥai Ro’i (Genesis 25:11).
“It was after the death of Abraham, God blessed Isaac his son” – Rabbi Simon said: Everywhere that it is stated “it was after [the death],” the world regressed. “It was after the death of Abraham” – immediately, “All the cisterns…the Philistines sealed them after Abraham’s death” (Genesis 26:15, 18). “It was after the death of Moses, servant of the Lord” (Joshua 1:1) – immediately, the well, the clouds of glory, and the manna ceased. “It was after Joshua’s death” (Judges 1:1) – immediately, the pegs of the Land waged war against them.11The reference is to the Canaanite nations. They are called “pegs,” as in Numbers 33:55: "Those whom you leave over will be like pegs in your eyes and thorns in your side.” “It was after Saul’s death” (II Samuel 1:1) – “the Philistines were waging war against Israel” (I Samuel 31:1). The students raised an objection to Rabbi Simon: ‘But is it not written: “After the death of Yehoyada, the princes of Judah came and prostrated themselves to the king”?’ (II Chronicles 24:17).12There does not appear to be any regression there. Rabbi Tanḥuma said: ‘Rabbi Simon came to say [his rule] only concerning [the phrase] “it was after [the death].”’13Whereas in this verse, the words “it was” are missing from the formula.
Rabbi Yudan said: [The words “it was after the death” of certain people connote that] the world would have regressed had the Holy One blessed be He not established others in their stead, as it is written: “It was after Abraham’s death,” and it is written: “Isaac dug anew” (Genesis 26:18). “It was after the death of Moses, servant of the Lord, the Lord said to Joshua son of Nun, saying” (Joshua 1:1). And it is written: “It was after Joshua’s death…the Lord said: Judah will ascend” (Judges 1:1–2). It is written: “It was after Saul’s death and David had returned from smiting the Amalekites, and David had stayed in Tziklag [two] days” (II Samuel 1:1),14David immediately took Saul’s place as military leader. and it is written prior to this matter, [even] prior to Samuel’s death: “David was the son of a nobleman…” (I Samuel 17:12).15This is the opening verse of the passage describing the beginning of David’s career as a warrior, when he slew Goliath.

Sifrei Devarim

(We are hereby taught that peace is offered for two days, and a third day before the battle. And so it states: (I Samuel 30:1) "And David Remained in Tziklag for two days." And gentile cities are not besieged fewer than three days before the Sabbath, (so that the siege not extend into the Sabbath); but if the siege began, it is not interrupted. This is one of three lessons taught by Shammai the Elder: A sea voyage is not begun fewer than three days before the Sabbath. When is this so? For a long voyage, but for a short one, it is permissible.)