law-common 10.11.1-beta.0 → 10.11.1-beta.1
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.
|
@@ -75,15 +75,16 @@ class DateCodeModel {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
getDateInIST() {
|
|
78
|
-
//
|
|
79
|
-
const baseDateUTC = this.getDate();
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
// convert bill date (utc midnight) to ist midnight
|
|
79
|
+
const baseDateUTC = this.getDate();
|
|
80
|
+
const istOffsetMs = 5.5 * 60 * 60 * 1000;
|
|
81
|
+
const billDateIST = new Date(baseDateUTC.getTime() + istOffsetMs);
|
|
82
|
+
// get current ist time (proper local hours)
|
|
83
|
+
const nowUTC = new Date();
|
|
84
|
+
const nowIST = new Date(nowUTC.getTime() + istOffsetMs);
|
|
85
|
+
// Apply ist time components
|
|
86
|
+
billDateIST.setHours(nowIST.getHours(), nowIST.getMinutes(), nowIST.getSeconds(), nowIST.getMilliseconds());
|
|
87
|
+
return billDateIST;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
exports.DateCodeModel = DateCodeModel;
|