Hi All, I trying to build an extension to set an i...
# suitecommerce
d
Hi All, I trying to build an extension to set an item Option of date format below is the code I'm using var $target = jQuery(e.currentTarget) , value = $target.val() || $target.data('value') || null _pdp.setOption(cart_option_id, value);_ The Date preference on backend is D/M/YYYY When I set the value as "*12/02/2021*" on the backend it is converted to "*02/12/2021*" instead of 12th FEB it is getting set as 2nd DEC not sure why it is happening any ideas??
s
One of two things is happening: your NetSuite account is setup to handle dates (this is a company/account wide setting) as MM/DD/YYYY OR NetSuite only accepts dates in that format. I haven't experimented to find out which, so I would look into the first one.
d
@Steve Goldberg The company wide account setting is D/M/YYYY any ideas on how to handle this?
s
I honestly don't know the answer. I would look more into how NetSuite handles dates that are sent to it. You may need to perform a transformation before it is sent to NetSuite
e
It seems like your issue is in the backend, try to use this on your suitescript file: nlapiDateToString to set in the expected format date