NG-Client: JSUtils dateFormat() is deprecated

Forum to discuss the new web client version of Servoy.

NG-Client: JSUtils dateFormat() is deprecated

Postby tgs » Thu Dec 20, 2018 8:17 pm

I get this warning in NG-Client for utils.dateFormat():

utils_dateFormat.png


It seems to work, but I don't trust this. Is there a replaced function in NG for that?
You do not have the required permissions to view the files attached to this post.
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: NG-Client: JSUtils dateFormat() is deprecated

Postby tgs » Fri Dec 21, 2018 1:59 pm

I could fix it:

Code: Select all
_newRec.delivery_datetime = utils.dateFormat(new Date(_orderValue[7]),'dd.MM.yyyy HH:mm');
_newRec.deadline_datetime = utils.dateFormat(new Date(_orderValue[8]),'dd.MM.yyyy HH:mm');
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: NG-Client: JSUtils dateFormat() is deprecated

Postby Joas » Fri Dec 21, 2018 2:08 pm

The dateFormat function is deprecated when using a string as argument, you should use utils.parseDate(string, format) instead (or make sure that you pass a date).

Note that if you press <Alt> while hovering a deprecated function, the tooltip explains which function to use instead:

dateFormat.png
You do not have the required permissions to view the files attached to this post.
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 6 guests

cron