ESQ retrieve Date

Dear mates,

How can i format date in Creation source code ?

When i do this:

var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
   rootSchemaName: "Order"
});
 
esq.addColumn("Date");
 
esq.getEntityCollection( function(result) {
    result.collection.each ( function (order) {
       this.console.log(Date);
    });
});

the system return me:

function Date() { [native code] }

What the way to format Date ?

Thanks,

Nicolas

 

Like 0

Like

2 comments

The Date can be formatted via default js functions. Please feel free to find out more about working with Date in JavaScript in the article by the link below:

https://css-tricks.com/everything-you-need-to-know-about-date-in-javascript/

Also there are some examples of working with Date in ESQ in the article on academy :

https://academy.creatio.com/documents/technic-sdk/7-15/entityschemaquery-class-filters-handling

 

You can format the date based on the current users culture settings using the following:

var formattedDateString = myDate.toLocaleDateString(Terrasoft.currentUserCultureName);

Ryan

Show all comments