@osimatic/helpers-js 1.1.44 → 1.1.45
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/CHANGELOG +3 -0
- package/date_time.js +18 -0
- package/package.json +1 -1
package/CHANGELOG
CHANGED
|
@@ -66,3 +66,6 @@ var serviceCountry = 'XX' -> TelephoneNumber.setLocalCountryCode('XX')
|
|
|
66
66
|
|
|
67
67
|
1.1.28
|
|
68
68
|
ImportFromCsv.initModal() -> ImportFromCsv.initForm()
|
|
69
|
+
|
|
70
|
+
1.1.44
|
|
71
|
+
Toutes les fonctions des classes SqlTime, SqlDate et SqlDateTime prennent maintenant les dates et heures SQL en UTC. CECI EST TRES IMPORTANT SINON CELA FAUSSE LES DATES/HEURES SELON LES FUSEAUX HORAIRES.
|
package/date_time.js
CHANGED
|
@@ -390,6 +390,9 @@ class TimestampUnix {
|
|
|
390
390
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Les dates SQL fournies en paramètre doivent être en UTC.
|
|
395
|
+
*/
|
|
393
396
|
class SqlDate {
|
|
394
397
|
static parse(sqlDate) {
|
|
395
398
|
if (sqlDate == null) {
|
|
@@ -413,6 +416,10 @@ class SqlDate {
|
|
|
413
416
|
return SqlDateTime.getDateForInputDate(sqlDate+" 00:00:00", timeZone);
|
|
414
417
|
}
|
|
415
418
|
|
|
419
|
+
static getTimestamp(sqlDate) {
|
|
420
|
+
return SqlDateTime.getTimestamp(sqlDate+" 00:00:00");
|
|
421
|
+
}
|
|
422
|
+
|
|
416
423
|
static getYear(sqlDate) {
|
|
417
424
|
return SqlDateTime.getYear(sqlDate+" 00:00:00");
|
|
418
425
|
}
|
|
@@ -432,6 +439,9 @@ class SqlDate {
|
|
|
432
439
|
|
|
433
440
|
}
|
|
434
441
|
|
|
442
|
+
/**
|
|
443
|
+
* Les heures SQL fournies en paramètre doivent être en UTC.
|
|
444
|
+
*/
|
|
435
445
|
class SqlTime {
|
|
436
446
|
static parse(sqlTime) {
|
|
437
447
|
if (sqlTime == null) {
|
|
@@ -468,8 +478,16 @@ class SqlTime {
|
|
|
468
478
|
static getTimeForInputTime(sqlTime, timeZone="Europe/Paris", withSeconds=false) {
|
|
469
479
|
return SqlDateTime.getTimeForInputTime('1970-01-01 '+sqlTime, timeZone, withSeconds);
|
|
470
480
|
}
|
|
481
|
+
|
|
482
|
+
static getTimestamp(sqlTime) {
|
|
483
|
+
return SqlDateTime.getTimestamp('1970-01-01 '+sqlTime);
|
|
484
|
+
}
|
|
485
|
+
|
|
471
486
|
}
|
|
472
487
|
|
|
488
|
+
/**
|
|
489
|
+
* Les dates/heures SQL fournies en paramètre doivent être en UTC.
|
|
490
|
+
*/
|
|
473
491
|
class SqlDateTime {
|
|
474
492
|
static getCurrentSqlDateTime() {
|
|
475
493
|
return DateTime.getSqlDateTime(new Date());
|