Hello Everyone, Has anyone switched over to use Lu...
# suitescript
r
Hello Everyone, Has anyone switched over to use Luxon JS from Moment JS. I have been trying to get it to work error
Copy code
org.mozilla.javascript.EcmaError: TypeError: Cannot find function assign in object function Object() { [native code for Object.Object, arity=1] }
. (/...XXXXX.../lib/luxon.js#3156)
b
up your code to 2.1
👍 1
Object.assign is newer than ecmascript 5
s
or try date-fns
r
yeah was running as 2.X let me try 2.1
@battk that did the trick. Updating to 2.1 .few more months and 2.1 will be the norm
Thank you @battk
b
tell me how the timezone related features work
r
Ok will do.. currently just gives me the NS server time (USA) and timezone did set correctly .. will investigate and let you know
Copy code
log.debug('moment', moment().format('LLL'));
        log.debug('luxon.DateTime.local()', luxon.DateTime.local());
        log.debug('luxon.DateTime setZone', luxon.DateTime.local().setZone("Australia/Melbourne"));
        log.debug('luxon.DateTime setZone America/New_York', luxon.DateTime.local().setZone("America/New_York"));