Artisan SVG > Script (script) (file-format-javascript)

Get list of dates between start and end date

Snippet
Universal
Intermediate

Snippets are pieces of workflows. You can copy and paste them directly into any Tray workflow.

New to snippets? Watch this video

For more details please see our Snippet Documentation

About this Snippet
Copy

Get an array of all the dates between a start and end date. Must use YYYY-MM-DD format for inputs.

If you feed it September 2, 2023 and September 28, 2023, the returned payload is the following:

1
{
2
"result": [
3
"2023-09-03",
4
"2023-09-04",
5
"2023-09-05",
6
"2023-09-06",
7
"2023-09-07",
8
"2023-09-08",
9
"2023-09-09",
10
"2023-09-10",
11
"2023-09-11",
12
"2023-09-12",
13
"2023-09-13",
14
"2023-09-14",
15
"2023-09-15",
16
"2023-09-16",
17
"2023-09-17",
18
"2023-09-18",
19
"2023-09-19",
20
"2023-09-20",
21
"2023-09-21",
22
"2023-09-22",
23
"2023-09-23",
24
"2023-09-24",
25
"2023-09-25",
26
"2023-09-26",
27
"2023-09-27"
28
],
29
"console": []
30
}

See it in action
Copy