Hi all, I'm seeing if it's possible to manipulate a date function so i could use date fields as a range to update the feature each month automatically, and won't have to change the year every time. Here is the code I have so far.
When building the date, just insert a variable for the year
var time = Now(); var time3 = Text(Now(), "MMMM DD, YYYY"); var thisYear = Year(Now()); if (time >= Date(thisYear, 7, 1) && time < Date(thisYear, 8, 1)) { return $feature["August"]; }
Arcade has a Month() function. It returns 1 (Jan) - 12 (Dec).Date functions | ArcGIS Arcade | Esri Developerthis article should have all the code you need, incl. a dictionary to map the number to the month name.How To: Extract Month Names from a Date Field Using ArcGIS Arcade in Map Viewer
Thanks for the help, but I should have been clearer - I'm looking for a Date function that only takes the month and day, but without the year.
thank you Ken! That worked!
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.