cancel
Showing results for 
Search instead for 
Did you mean: 

Fixing warnings of toLocaleDateTimeString()

keerthi_maduru
New Contributor II

We are getting this Warning:Date.toLocaleDateTimeString() arguments
Resolution:Use an object-literal to pass extra arguments to toLocaleDateTimeString(), when we are using this statement - Date.parse(XXX).toLocaleDateTimeString(‘{“timeZone”:“America/Phoenix”, “format”:“yyyyMMddHHmm”}’). Please let me know your thoughts on this.

3 REPLIES 3

dmiller
Admin Admin
Admin

Try removing the single quotes, so it reads as Date.parse(XXX).toLocaleDateTimeString({“timeZone”:“America/Phoenix”, “format”:“yyyyMMddHHmm”}).

I believe there was an error in the docs that showed including the single quotes.


Diane Miller
Community Manager

nganapathiraju
Former Employee

please refer an earlier post

keerthi_maduru
New Contributor II

Removing quotes worked. Thanks!