Received different number from JavaScript's getDay() on different platform.

75
1
10-30-2020 12:30 PM
New Contributor

Did anyone having the problem on extending their Survey123 form with JavaScript code? I was trying to get the day of week by passing the date I selected from the form to my JavaScript function and show the day of week on the form.

I found that the function returns 0 for Sunday when using Survey123 Connect while returns 0 for Monday when manipulating on every browser.

What I code in that function was simple, just return new Date(inputDate).getDay(); .

Reply
0 Kudos
1 Reply
Esri Contributor

Hi Jack,

One thing to check is whether there is any difference in locale between your browser and Operating System?Different locales use different values for firstDayOfWeek. 

Brett

Reply
0 Kudos