ServerJS/DateTime: Difference between revisions
< ServerJS
Jump to navigation
Jump to search
(→Prior Art: better link with more examples) |
|||
Line 11: | Line 11: | ||
Date.equals | Date.equals | ||
* datejs, clientside library. nifty & big. http:// | * datejs, clientside library. nifty & big. http://code.google.com/p/datejs/ | ||
// Get today’s date | // Get today’s date |
Revision as of 09:28, 22 June 2009
Date and Time
EcmaScript already supports a wide range of functions handling Date, see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date
but those kind of setters/getters are not very convinient when working with DateTimes. an easy way to e.g. add/substract timeranges, calculate time-diffs, etc. would be beneficial.
Prior Art
- helma NGs, minimal date extensions. http://github.com/hns/helma-ng/blob/8077ce9636d33d1ce678f52698470b4d5316841c/modules/core/date.js
Date.diff Date.getTimespan Date.equals
- datejs, clientside library. nifty & big. http://code.google.com/p/datejs/
// Get today’s date Date.today(); // Add 5 days to today Date.today().add(5).days(); // Get Friday of this week Date.friday(); // Get March of this year Date.march(); // Is today Friday? Date.today().is().friday(); // true|false