Skip to content

Commit

Permalink
hotfix jumpDate
Browse files Browse the repository at this point in the history
  • Loading branch information
uvarov-frontend committed Sep 21, 2023
1 parent a054e29 commit 37e7f45
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package/build/vanilla-calendar.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package/build/vanilla-calendar.min.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const controlArrows = (self) => {
const defaultControl = () => {
if (!self.dateMin || !self.dateMax)
return;
const jumpDateMin = new Date(generateDate(new Date(self.selectedYear, self.selectedMonth, 1)));
const jumpDateMin = /* @__PURE__ */ new Date(`${generateDate(new Date(self.selectedYear, self.selectedMonth, 1))}T00:00:00`);
const jumpDateMax = new Date(jumpDateMin.getTime());
jumpDateMin.setMonth(jumpDateMin.getMonth() - self.jumpMonths);
jumpDateMax.setMonth(jumpDateMax.getMonth() + self.jumpMonths);
Expand Down Expand Up @@ -1077,7 +1077,7 @@ const handlerInput = (self) => {
const changeMonth = (self, route) => {
if (self.selectedMonth === void 0 || self.selectedYear === void 0)
return;
const jumpDate = new Date(generateDate(new Date(self.selectedYear, self.selectedMonth, 1)));
const jumpDate = /* @__PURE__ */ new Date(`${generateDate(new Date(self.selectedYear, self.selectedMonth, 1))}T00:00:00`);
switch (route) {
case "prev":
jumpDate.setMonth(jumpDate.getMonth() - self.jumpMonths);
Expand Down
2 changes: 1 addition & 1 deletion package/src/scripts/methods/changeMonth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import showYear from './showYear';

const changeMonth = (self: IVanillaCalendar, route: string | undefined) => {
if (self.selectedMonth === undefined || self.selectedYear === undefined) return;
const jumpDate = new Date(generateDate(new Date(self.selectedYear, self.selectedMonth, 1)));
const jumpDate = new Date(`${generateDate(new Date(self.selectedYear, self.selectedMonth, 1))}T00:00:00`);

switch (route) {
case 'prev':
Expand Down
2 changes: 1 addition & 1 deletion package/src/scripts/methods/controlArrows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const controlArrows = (self: IVanillaCalendar) => {
const defaultControl = () => {
if (!self.dateMin || !self.dateMax) return;

const jumpDateMin = new Date(generateDate(new Date(self.selectedYear as number, self.selectedMonth as number, 1)));
const jumpDateMin = new Date(`${generateDate(new Date(self.selectedYear as number, self.selectedMonth as number, 1))}T00:00:00`);
const jumpDateMax = new Date(jumpDateMin.getTime());
jumpDateMin.setMonth(jumpDateMin.getMonth() - self.jumpMonths);
jumpDateMax.setMonth(jumpDateMax.getMonth() + self.jumpMonths);
Expand Down

0 comments on commit 37e7f45

Please sign in to comment.