-
Notifications
You must be signed in to change notification settings - Fork 664
Moment.js
Mathias Rangel Wulff edited this page Jun 13, 2015
·
2 revisions
You can use Moment.js library to format dates:
moment.locale('fr'); // Set French locale for moment.js
alasql.fn.moment = moment; // Set moment() function available to AlaSQL
var data = [{d:new Date()},{d:"2013-02-14"}];
var res = alasql('SELECT moment(d)->[add](1, "days")->calendar() as [When?]\
FROM ?',[data]);
See the full example in jsFiddle
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo