@amaui/date
Advanced tools
Comparing version 1.1.15 to 1.1.16
@@ -32,3 +32,3 @@ "use strict"; | ||
case 'week': | ||
return new AmauiDate_1.default(endOf(add(7 - amauiDate.dayWeek, 'day', amauiDate), 'day')); | ||
return new AmauiDate_1.default(endOf(add((amauiDate.dayWeek === 0 ? 0 : 7 - amauiDate.dayWeek), 'day', amauiDate), 'day')); | ||
case 'month': | ||
@@ -35,0 +35,0 @@ return new AmauiDate_1.default(new Date(amauiDate.value.setMonth(amauiDate.month, 0)).setHours(23, 59, 59, 999)); |
@@ -37,3 +37,3 @@ import AmauiDate from './AmauiDate'; // circular dependency issue fix | ||
case 'week': | ||
return new AmauiDate(endOf(add(7 - amauiDate.dayWeek, 'day', amauiDate), 'day')); | ||
return new AmauiDate(endOf(add(amauiDate.dayWeek === 0 ? 0 : 7 - amauiDate.dayWeek, 'day', amauiDate), 'day')); | ||
@@ -40,0 +40,0 @@ case 'month': |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiDate v1.1.15 | ||
/** @license AmauiDate v1.1.16 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -24,3 +24,3 @@ import AmauiDate from './AmauiDate'; | ||
case 'week': | ||
return new AmauiDate(startOf(remove(amauiDate.dayWeek - 1, 'day', amauiDate), 'day')); | ||
return new AmauiDate(startOf(remove((amauiDate.dayWeek === 0 ? 7 : amauiDate.dayWeek) - 1, 'day', amauiDate), 'day')); | ||
@@ -27,0 +27,0 @@ case 'month': |
{ | ||
"name": "@amaui/date", | ||
"version": "1.1.15", | ||
"version": "1.1.16", | ||
"description": "Time and date utils library", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/amaui-org/amaui-date.git", |
@@ -22,3 +22,3 @@ "use strict"; | ||
case 'week': | ||
return new AmauiDate_1.default(startOf((0, remove_1.default)(amauiDate.dayWeek - 1, 'day', amauiDate), 'day')); | ||
return new AmauiDate_1.default(startOf((0, remove_1.default)((amauiDate.dayWeek === 0 ? 7 : amauiDate.dayWeek) - 1, 'day', amauiDate), 'day')); | ||
case 'month': | ||
@@ -25,0 +25,0 @@ return new AmauiDate_1.default(new Date(amauiDate.value.setDate(1)).setHours(0, 0, 0, 0)); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
449816