disacomp-dateservice 1.0.5 → 1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disacomp-dateservice",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Disacomp Date Service",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -159,6 +159,7 @@ class DateManipulator implements IDateManipulator {
159
159
  const parsedDate = new Date(Date.UTC(year, month - 1, day));
160
160
 
161
161
  return (
162
+ date.length === 10 &&
162
163
  parsedDate.getUTCFullYear() === year &&
163
164
  parsedDate.getUTCMonth() + 1 === month &&
164
165
  parsedDate.getUTCDate() === day
@@ -213,9 +214,8 @@ class DateManipulator implements IDateManipulator {
213
214
  endDate: string;
214
215
  } {
215
216
  const startDate = `01-${this.addCeroAtBegin(month)}-${year}`;
216
- const endDate = `${DateHelper.getDaysInMonth(
217
- month,
218
- year
217
+ const endDate = `${this.addCeroAtBegin(
218
+ DateHelper.getDaysInMonth(month, year)
219
219
  )}-${this.addCeroAtBegin(month)}-${year}`;
220
220
  return { startDate, endDate };
221
221
  }