@osimatic/helpers-js 1.1.41 → 1.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/date_time.js +4 -4
- package/package.json +1 -1
package/date_time.js
CHANGED
|
@@ -91,8 +91,8 @@ class DateTime {
|
|
|
91
91
|
static getDateForInputDate(jsDate, timeZone="Europe/Paris") {
|
|
92
92
|
return this.getSqlDate(jsDate, timeZone);
|
|
93
93
|
}
|
|
94
|
-
static getTimeForInputTime(jsDate, timeZone="Europe/Paris") {
|
|
95
|
-
return jsDate.toLocaleTimeString('en-GB', {hour: 'numeric', timeZone: timeZone, hour12: false}).padStart(2, '0')+':'+jsDate.toLocaleTimeString('en-GB', {minute: 'numeric', timeZone: timeZone, hour12: false}).padStart(2, '0');
|
|
94
|
+
static getTimeForInputTime(jsDate, timeZone="Europe/Paris", withSeconds=false) {
|
|
95
|
+
return jsDate.toLocaleTimeString('en-GB', {hour: 'numeric', timeZone: timeZone, hour12: false}).padStart(2, '0')+':'+jsDate.toLocaleTimeString('en-GB', {minute: 'numeric', timeZone: timeZone, hour12: false}).padStart(2, '0')+(withSeconds?':'+jsDate.toLocaleTimeString('en-GB', {second: 'numeric', timeZone: timeZone, hour12: false}).padStart(2, '0'):'');
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
static getTimestamp(jsDate) {
|
|
@@ -362,8 +362,8 @@ class TimestampUnix {
|
|
|
362
362
|
static getDateForInputDate(timestamp, timeZone="Europe/Paris") {
|
|
363
363
|
return DateTime.getDateForInputDate(this.parse(timestamp), timeZone);
|
|
364
364
|
}
|
|
365
|
-
static getTimeForInputTime(timestamp, timeZone="Europe/Paris") {
|
|
366
|
-
return DateTime.getTimeForInputTime(this.parse(timestamp), timeZone);
|
|
365
|
+
static getTimeForInputTime(timestamp, timeZone="Europe/Paris", withSeconds=false) {
|
|
366
|
+
return DateTime.getTimeForInputTime(this.parse(timestamp), timeZone, withSeconds);
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
static isDateEqual(timestamp1, timestamp2) {
|