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
- // Step 1: Get UTC midnight for dateCode
79
- const baseDateUTC = this.getDate(); // already parses yyyyMMdd correctly
80
- // Step 2: Convert to IST by adding 5.5 hours
81
- const istOffset = 5.5 * 60 * 60 * 1000;
82
- const baseDateIST = new Date(baseDateUTC.getTime() + istOffset);
83
- // Step 3: Apply current IST time (hours/min/sec)
84
- const now = new Date();
85
- baseDateIST.setHours(now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
86
- return baseDateIST;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.11.1-beta.0",
3
+ "version": "10.11.1-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [