@annalib/anna-core 2.7.4 → 2.7.5
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 +7 -1
- package/fesm2015/annalib-anna-core.mjs +6 -0
- package/fesm2015/annalib-anna-core.mjs.map +1 -1
- package/fesm2020/annalib-anna-core.mjs +6 -0
- package/fesm2020/annalib-anna-core.mjs.map +1 -1
- package/lib/anna-core-shared-lib/services/anna-date-time-format.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -334,6 +334,12 @@ class AnnaDateTimeFormatService {
|
|
|
334
334
|
compareDate(a, b, isAsc) {
|
|
335
335
|
return isAsc ? moment(a).diff(b) : moment(b).diff(a);
|
|
336
336
|
}
|
|
337
|
+
static formatTwentyFourHourTimeToHHMMAFormat(value) {
|
|
338
|
+
value = moment(value, ["HH:mm:ss"]).format("HH:mm:ss");
|
|
339
|
+
return value[3] == "0" && value[4] == "0"
|
|
340
|
+
? moment(value, ["HH:mm:ss"]).format("hA").slice(0, -1)
|
|
341
|
+
: moment(value, ["HH:mm:ss"]).format("h:mmA").slice(0, -1);
|
|
342
|
+
}
|
|
337
343
|
formatDateAndHHMMATimeToStandardFormat(dateAndTime) {
|
|
338
344
|
let standardFormat, date, time;
|
|
339
345
|
if (dateAndTime.includes("|")) {
|