]> git.proxmox.com Git - sencha-touch.git/blob - src/src/core/lang/Date.js
import Sencha Touch 2.4.2 source
[sencha-touch.git] / src / src / core / lang / Date.js
1 //@tag foundation,core
2 //@define Ext.Date
3 //@require Ext.Error
4
5 /**
6 * Note: Date values are zero-based.
7 */
8 Ext.Date = {
9 /** @ignore */
10 now: Date.now,
11
12 /**
13 * @private
14 * Private for now
15 */
16 toString: function(date) {
17 if (!date) {
18 date = new Date();
19 }
20
21 var pad = Ext.String.leftPad;
22
23 return date.getFullYear() + "-"
24 + pad(date.getMonth() + 1, 2, '0') + "-"
25 + pad(date.getDate(), 2, '0') + "T"
26 + pad(date.getHours(), 2, '0') + ":"
27 + pad(date.getMinutes(), 2, '0') + ":"
28 + pad(date.getSeconds(), 2, '0');
29 }
30 };
31
32 //<deprecated product=touch since="2.0">
33 Ext.merge(Ext, {
34 util: {
35 Date: Ext.Date
36 }
37 });
38 //</deprecated>