Skip to content

Commit

Permalink
Merge pull request #116 from uvarov-frontend/hotfix/jump_date_utc
Browse files Browse the repository at this point in the history
Hotfix JumpDate UTC
  • Loading branch information
uvarov-frontend authored Sep 21, 2023
2 parents a054e29 + 0602548 commit 44a07a8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 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/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uvarov.frontend/vanilla-calendar",
"version": "2.6.3",
"version": "2.6.4",
"description": "VanillaCalendar is a pure JavaScript date and time picker that uses TypeScript so it supports any JS framework and library.",
"homepage": "https://vanilla-calendar.com",
"keywords": [
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 44a07a8

Please sign in to comment.