@nettyapps/ntybase 0.0.5 → 0.0.6
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.
|
@@ -658,6 +658,30 @@ class CommonService {
|
|
|
658
658
|
dateFormatter(dateValue) {
|
|
659
659
|
return this.datePipe.transform(dateValue, 'dd-MM-yyyy') ?? '';
|
|
660
660
|
}
|
|
661
|
+
/**
|
|
662
|
+
* Format date into 'dd-MM-yyyy HH:mm:ss' format for grids
|
|
663
|
+
* @param dateValue
|
|
664
|
+
* @param seconds if true, format includes seconds
|
|
665
|
+
* @returns
|
|
666
|
+
*/
|
|
667
|
+
dateTimeFormatter(dateValue, seconds = true) {
|
|
668
|
+
if (seconds) {
|
|
669
|
+
return this.datePipe.transform(dateValue, 'dd/MM/yyyy HH:mm:ss') ?? '';
|
|
670
|
+
}
|
|
671
|
+
return this.datePipe.transform(dateValue, 'dd/MM/yyyy HH:mm') ?? '';
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Format time into 'HH:mm' or 'HH:mm:ss' format for grids
|
|
675
|
+
* @param dateValue
|
|
676
|
+
* @param seconds if true, format includes seconds
|
|
677
|
+
* @returns
|
|
678
|
+
*/
|
|
679
|
+
timeFormatter(dateValue, seconds = false) {
|
|
680
|
+
if (seconds) {
|
|
681
|
+
return this.datePipe.transform(dateValue, 'HH:mm:ss') ?? '';
|
|
682
|
+
}
|
|
683
|
+
return this.datePipe.transform(dateValue, 'HH:mm') ?? '';
|
|
684
|
+
}
|
|
661
685
|
/** Reactive Signal state for tracking grid updates */
|
|
662
686
|
_updates = signal(null, ...(ngDevMode ? [{ debugName: "_updates" }] : []));
|
|
663
687
|
/** Read-only Signal for external components to observe updates */
|