date-time-js
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"name": "date-time-js", | ||
@@ -4,0 +4,0 @@ "title": "DateTimeJS", |
@@ -134,6 +134,21 @@ [npm-image]: https://img.shields.io/npm/v/date-time-js.svg | ||
**Chaining** | ||
let formattedDate = new DateTime('2015-02-21T10:45:30Z') | ||
.millisecond(10) | ||
.second(10) | ||
.minute(10) | ||
.hour(20) | ||
.date(25) | ||
.month(3) | ||
.year(2010) | ||
.add(2, 'millisecond') | ||
.subtract(3, 'millisecond') | ||
.offset(-180) | ||
.format('yyyy-MM-ddTHH:mm:ss.fffK'); // '2010-04-25T20:10:10.009-03:00' | ||
**Copying** | ||
var date = new DateTime('2015-02-21T10:45:00Z'); | ||
var dateCopy = date.copy(); | ||
let date = new DateTime('2015-02-21T10:45:00Z'); | ||
let dateCopy = date.copy(); | ||
@@ -140,0 +155,0 @@ ### Comparison |
@@ -38,8 +38,64 @@ export declare class DateTime { | ||
subtract(value: number, unit: string): DateTime; | ||
/** | ||
* Gets or sets the milliseconds of the date. | ||
* | ||
* @param {number} [millisecond] A number between 0 and 999, representing the milliseconds. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of milliseconds is 1005, the number of seconds is incremented by 1, and 5 is used for the milliseconds. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
millisecond(millisecond?: number): any; | ||
/** | ||
* Gets or sets the seconds of the date. | ||
* | ||
* @param {number} [second] A number between 0 and 59, representing the seconds. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of seconds is 100, the number of minutes is incremented by 1, and 40 is used for the seconds. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
second(second?: number): any; | ||
/** | ||
* Gets or sets the minutes of the date. | ||
* | ||
* @param {number} [minute] A number between 0 and 59, representing the minutes. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of minutes is 100, the number of hours is incremented by 1, and 40 is used for the minutes. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
minute(minute?: number): any; | ||
/** | ||
* Gets or sets the hours of the date. | ||
* | ||
* @param {number} [hour] A number between 0 and 23, representing the hours. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of hours is 30, the day of month is incremented by 1, and 6 is used for the hours. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
hour(hour?: number): any; | ||
/** | ||
* Gets or sets the day of the month of the date. | ||
* | ||
* @param {number} [date] A number representing the day of the month. If a specified number is outside of the range of date values for the month, the date information is updated accordingly. For example, if the day of the month is 0, the date is set to the last day of the previous month. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
date(date?: number): any; | ||
/** | ||
* Gets or sets the month of the date. | ||
* | ||
* @param {number} [month] A number between 0 and 11, representing the month. 0 corresponds to January, 1 to February, and so on. If a specified number is outside the expected range, the date information is updated accordingly. For example, if the month is 15, the year is incremented by 1, and 3 is used for the month. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
month(month?: number): any; | ||
/** | ||
* Gets or sets the year of the date. | ||
* | ||
* @param {number} [year] A number representing the year. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
year(year?: number): any; | ||
@@ -46,0 +102,0 @@ startOf(unit: string): DateTime; |
@@ -611,2 +611,10 @@ var DayAndMonth = (function () { | ||
}; | ||
/** | ||
* Gets or sets the milliseconds of the date. | ||
* | ||
* @param {number} [millisecond] A number between 0 and 999, representing the milliseconds. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of milliseconds is 1005, the number of seconds is incremented by 1, and 5 is used for the milliseconds. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
DateTime.prototype.millisecond = function (millisecond) { | ||
@@ -624,2 +632,10 @@ if (this.isEmpty()) { | ||
}; | ||
/** | ||
* Gets or sets the seconds of the date. | ||
* | ||
* @param {number} [second] A number between 0 and 59, representing the seconds. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of seconds is 100, the number of minutes is incremented by 1, and 40 is used for the seconds. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
DateTime.prototype.second = function (second) { | ||
@@ -637,2 +653,10 @@ if (this.isEmpty()) { | ||
}; | ||
/** | ||
* Gets or sets the minutes of the date. | ||
* | ||
* @param {number} [minute] A number between 0 and 59, representing the minutes. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of minutes is 100, the number of hours is incremented by 1, and 40 is used for the minutes. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
DateTime.prototype.minute = function (minute) { | ||
@@ -650,2 +674,10 @@ if (this.isEmpty()) { | ||
}; | ||
/** | ||
* Gets or sets the hours of the date. | ||
* | ||
* @param {number} [hour] A number between 0 and 23, representing the hours. If a specified number is outside the expected range, the date information is updated accordingly. For example, if number of hours is 30, the day of month is incremented by 1, and 6 is used for the hours. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
DateTime.prototype.hour = function (hour) { | ||
@@ -663,2 +695,10 @@ if (this.isEmpty()) { | ||
}; | ||
/** | ||
* Gets or sets the day of the month of the date. | ||
* | ||
* @param {number} [date] A number representing the day of the month. If a specified number is outside of the range of date values for the month, the date information is updated accordingly. For example, if the day of the month is 0, the date is set to the last day of the previous month. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
DateTime.prototype.date = function (date) { | ||
@@ -676,2 +716,10 @@ if (this.isEmpty()) { | ||
}; | ||
/** | ||
* Gets or sets the month of the date. | ||
* | ||
* @param {number} [month] A number between 0 and 11, representing the month. 0 corresponds to January, 1 to February, and so on. If a specified number is outside the expected range, the date information is updated accordingly. For example, if the month is 15, the year is incremented by 1, and 3 is used for the month. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
DateTime.prototype.month = function (month) { | ||
@@ -689,2 +737,10 @@ if (this.isEmpty()) { | ||
}; | ||
/** | ||
* Gets or sets the year of the date. | ||
* | ||
* @param {number} [year] A number representing the year. | ||
* @returns {any} Current DateTime instance on set, number on get. | ||
* | ||
* @memberOf DateTime | ||
*/ | ||
DateTime.prototype.year = function (year) { | ||
@@ -691,0 +747,0 @@ if (this.isEmpty()) { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
113292
914
223
0