diff options
Diffstat (limited to 'bin/wiki/ImportarDesdeURL/node_modules/moment/src/lib/moment/to-type.js')
-rw-r--r-- | bin/wiki/ImportarDesdeURL/node_modules/moment/src/lib/moment/to-type.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/wiki/ImportarDesdeURL/node_modules/moment/src/lib/moment/to-type.js b/bin/wiki/ImportarDesdeURL/node_modules/moment/src/lib/moment/to-type.js new file mode 100644 index 00000000..a990dd20 --- /dev/null +++ b/bin/wiki/ImportarDesdeURL/node_modules/moment/src/lib/moment/to-type.js @@ -0,0 +1,34 @@ +export function valueOf () { + return this._d.valueOf() - ((this._offset || 0) * 60000); +} + +export function unix () { + return Math.floor(this.valueOf() / 1000); +} + +export function toDate () { + return new Date(this.valueOf()); +} + +export function toArray () { + var m = this; + return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; +} + +export function toObject () { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; +} + +export function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; +} |