Did NS recently change the JS engine?
# suitescript
c
Did NS recently change the JS engine?
e
Not that I'm aware of, why do you ask?
c
new Date().toLocaleString().split(' ');
used to give me something like this:
["August","20,","2024","5:55:42","PM","PDT"]
Now I get this:
[ "11/15/2024,", "12:31:52 PM"]
This is server side.
e
What
NApiVersion
?
c
NApiVersion 2.0
e
Is that in a ClientScript or Server side script?
c
The former is from a UserEvent, the latter a ScheduledScript.
Server side.
e
Hmm, I've seen things like this when different users have different date preference settings but thought it only affected client side scripts.
I get the the latter when running in a UE script. Confirmed that User Preference makes no difference.
c
This is a screenshot of the split date array from server script logs on Aug 20:
e
Have you checked if you're getting same value in both Scheduled and UEs now?
c
Well ain't that something:
image.png
That's from a UE just now.
This is from a Scheduled Script just now:
e
Curious if anything changes if you're using 2.1 on both instead of 2.0
c
Well, that's even more interesting. 2.1 produces
Copy code
[
   "11/15/2024,",
   "1:41:12 PM"
]
and 2.0 does this
Copy code
[
   "November",
   "15,",
   "2024"
]
Lots to be said for have a good test framework.
e
2.1 and 2.0 are different engines, so that does make sense
ES2019 and ES5.1, respectively, I believe