-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3233294
commit 2f60577
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Seed dates in the delivery calendar, Tuesday thru Friday each week of the year. | ||
// -------------------------- | ||
|
||
let deliveryCalendarTable = base.getTable("Delivery Calendar"); | ||
let deliveryCalendarView = deliveryCalendarTable.getView("Grid view"); | ||
|
||
let deliveryCalendarResults = await deliveryCalendarView.selectRecordsAsync({fields: ['Delivery Weekend','Subscriptions']}); | ||
let deliveryStartDate = new Date("April 11, 2023"); | ||
let deliveryIterator = new Date(deliveryStartDate); | ||
|
||
for(let i = 0; i < 52; i++){ | ||
|
||
for(let j = 0; j < 4; j++){ | ||
|
||
let recordId = await deliveryCalendarTable.createRecordAsync({ | ||
"Delivery Weekend": new Date(deliveryIterator) | ||
}); | ||
|
||
deliveryIterator.setDate(deliveryIterator.getDate() + 1); | ||
} | ||
|
||
deliveryIterator.setDate(deliveryIterator.getDate() + 3); | ||
} |