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

328
1
10-30-2020 12:30 PM
JackLim
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(); .

0 Kudos
1 Reply
BrettStokes
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

0 Kudos