timezoned-date
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -93,2 +93,18 @@ 'use strict'; | ||
}, { | ||
key: 'toDateString', | ||
value: function toDateString() { | ||
if (isNaN(this.getDate())) { | ||
return 'Invalid date'; | ||
} | ||
return [daysOfWeek[this.getDay()], months[this.getMonth()], addZero(this.getDate()), this.getFullYear()].join(' '); | ||
} | ||
}, { | ||
key: 'toTimeString', | ||
value: function toTimeString() { | ||
if (isNaN(this.getDate())) { | ||
return 'Invalid date'; | ||
} | ||
return [addZero(this.getHours()), ':', addZero(this.getMinutes()), ':', addZero(this.getSeconds()), ' ', formatOffset(this.offset())].join(''); | ||
} | ||
}, { | ||
key: 'toString', | ||
@@ -99,3 +115,3 @@ value: function toString() { | ||
} | ||
return [daysOfWeek[this.getDay()], ' ', months[this.getMonth()], ' ', addZero(this.getDate()), ' ', this.getFullYear(), ' ', addZero(this.getHours()), ':', addZero(this.getMinutes()), ':', addZero(this.getSeconds()), ' ', formatOffset(this.offset())].join(''); | ||
return this.toDateString() + ' ' + this.toTimeString(); | ||
} | ||
@@ -211,3 +227,3 @@ }, { | ||
var ownPropsOfProto = ['toTimeString', 'toLocaleString', 'toLocaleDateString', 'toDateString', 'toLocaleTimeString']; | ||
var ownPropsOfProto = ['toLocaleString', 'toLocaleDateString', 'toLocaleTimeString']; | ||
var _iteratorNormalCompletion = true; | ||
@@ -308,3 +324,3 @@ var _didIteratorError = false; | ||
// A Date whose UTC time is the local time of this object's real time. | ||
// A Date whose "UTC time" is the local time of this object's real time. | ||
// That is, it is incorrect by `offset` minutes. Used for `getDate` et al. | ||
@@ -311,0 +327,0 @@ function getLocalDate(date) { |
{ | ||
"name": "timezoned-date", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "description": "Work with timezone-aware dates", |
21770
337