Forum Discussion

keerthi_maduru's avatar
keerthi_maduru
New Contributor II
8 years ago

Fixing warnings of toLocaleDateTimeString()

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

  • dmiller's avatar
    dmiller
    Former Employee

    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.

  • please refer an earlier post