This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
date
larukedi edited this page Nov 17, 2014
·
6 revisions
Usage: $l.date.parseEpoch(timespan[, limitWithWeeks])
console.log($l.date.parseEpoch(5000)); // returns '5 seconds'
Usage: $l.date.getDateString(date[, monthNames])
console.log($l.date.getDateString(new Date())); // returns 'now'
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
console.log($l.date.getDateString(yesterday)); // returns 'a day'
var someday = new Date(2010, 1, 1, 0, 0);
console.log($l.date.getDateString(someday)); // returns '01.02.2010'
console.log($l.date.getDateString(someday, true)); // returns '01 Feb 2010'
Usage: $l.date.getLongDateString(date[, monthNames, includeTime])
var now = new Date();
console.log($l.date.getLongDateString(now)); // returns '17.11.2014'
console.log($l.date.getLongDateString(now, true)); // returns '17 Nov 2014'
console.log($l.date.getLongDateString(now, true, true)); // returns '17 Nov 2014 01:47'
Please don't hesitate to submit issues and pull requests.