@annalib/anna-core 7.0.2 → 7.0.3
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/esm2020/lib/anna-core-shared-lib/services/anna-date-time-format.service.mjs +6 -5
- package/fesm2015/annalib-anna-core.mjs +5 -4
- package/fesm2015/annalib-anna-core.mjs.map +1 -1
- package/fesm2020/annalib-anna-core.mjs +5 -4
- package/fesm2020/annalib-anna-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -379,14 +379,15 @@ class AnnaDateTimeFormatService {
|
|
|
379
379
|
return isAsc ? dayjs(a).diff(b) : dayjs(b).diff(a);
|
|
380
380
|
}
|
|
381
381
|
static formatTwentyFourHourTimeToHHMMAFormat(value, date) {
|
|
382
|
-
value = dayjs(date ? date : '01/01/2000 ' + value).format("HH:mm:ss");
|
|
383
|
-
return value[
|
|
382
|
+
value = dayjs(date ? date : '01/01/2000 ' + value).format("MM/DD/YYYY HH:mm:ss");
|
|
383
|
+
return value[14] == "0" && value[15] == "0"
|
|
384
384
|
? dayjs(value, ["HH:mm:ss"]).format("hA").slice(0, -1)
|
|
385
385
|
: dayjs(value, ["HH:mm:ss"]).format("h:mmA").slice(0, -1);
|
|
386
386
|
}
|
|
387
387
|
static formatTwelveHourTimeToHHMMAFormat(timeValue, date) {
|
|
388
|
-
timeValue = dayjs(date ? date : '01/01/2000 ' + timeValue).format("HH:mm:ss");
|
|
389
|
-
|
|
388
|
+
timeValue = dayjs(date ? date : '01/01/2000 ' + timeValue).format("MM/DD/YYYY HH:mm:ss");
|
|
389
|
+
// check if min==00
|
|
390
|
+
return timeValue[14] == "0" && timeValue[15] == "0"
|
|
390
391
|
? dayjs(timeValue, ["HH:mm:ss"]).format("hA").slice(0, -1)
|
|
391
392
|
: dayjs(timeValue, ["HH:mm:ss"]).format("h:mmA").slice(0, -1);
|
|
392
393
|
}
|