Skip to content

Commit 9c14880

Browse files
committed
big refactor and bugfix
1 parent 6213369 commit 9c14880

11 files changed

+460
-851
lines changed

dist/draggableCal.common.js

+162-336
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/draggableCal.common.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/draggableCal.umd.js

+162-336
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/draggableCal.umd.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/draggableCal.umd.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/draggableCal.umd.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-draggable-cal",
3-
"version": "2.0.1",
3+
"version": "2.2.0",
44
"main": "dist/draggableCal.common.js",
55
"module": "dist/draggableCal.esm.js",
66
"unpkg": "dist/draggableCal.umd.js",

src/App.vue

+119-166
Large diffs are not rendered by default.

src/utils/CONSTANTS.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const language = {
1+
export default {
22
FR: {
33
DAYS: ['DIMANCHE', 'LUNDI', 'MARDI', 'MERCREDI', 'JEUDI', 'VENDREDI', 'SAMEDI'],
44
MONTHS: [

src/utils/buildCalendar.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ function splitDate(date) {
1212
};
1313
}
1414

15-
export function computeMonthsFromDays(NUMBER_OF_DAYS) {
15+
function computeMonthsFromDays(NUMBER_OF_DAYS) {
1616
const date = new Date(gYear(TODAY), gMonth(TODAY), gDay(TODAY) + NUMBER_OF_DAYS);
1717
const NUMBER_OF_MONTHS = (gYear(date) - gYear(TODAY)) * 12 + gMonth(date) - gMonth(TODAY);
1818
return NUMBER_OF_MONTHS;
1919
}
20-
export function computeDaysFromMonths(NUMBER_OF_MONTH) {
20+
function computeDaysFromMonths(NUMBER_OF_MONTH) {
2121
const NUMBER_OF_DAYS =
2222
(Date.UTC(gYear(TODAY), gMonth(TODAY) + NUMBER_OF_MONTH) -
2323
Date.UTC(gYear(TODAY), gMonth(TODAY))) /
2424
(1000 * 60 * 60 * 24);
2525
return NUMBER_OF_DAYS;
2626
}
2727

28-
export function createDaysArray(NUMBER_OF_DAYS, fullMonths) {
28+
function createDaysArray(NUMBER_OF_DAYS, fullMonths) {
2929
if (NUMBER_OF_DAYS <= 0) return [];
3030
let currentConstructorDate = new Date();
3131
const days = [];
@@ -47,7 +47,7 @@ export function createDaysArray(NUMBER_OF_DAYS, fullMonths) {
4747
return days;
4848
}
4949

50-
export function createMonthsArray(NUMBER_OF_MONTHS) {
50+
function createMonthsArray(NUMBER_OF_MONTHS) {
5151
if (NUMBER_OF_MONTHS <= 0) return [];
5252
let currentConstructorMonth = new Date();
5353
const months = [];
@@ -67,7 +67,7 @@ export function createMonthsArray(NUMBER_OF_MONTHS) {
6767
return months;
6868
}
6969

70-
export function createPrependArray(PREPEND_MONTHS) {
70+
function createPrependArray(PREPEND_MONTHS) {
7171
const prepended = [{fullYear: gYear(TODAY), monthNumber: gMonth(TODAY)}];
7272
for (let i = 0; i < PREPEND_MONTHS; i++) {
7373
let year = prepended[0].fullYear;
@@ -82,7 +82,7 @@ export function createPrependArray(PREPEND_MONTHS) {
8282
return prepended;
8383
}
8484

85-
export function buildYear(year) {
85+
function buildYear(year) {
8686
let currentConstructorDate = new Date(Date.UTC(year, 0, 1));
8787
const isLeap = year % 4 === 0 ? 1 : 0;
8888
const entireYear = {

src/utils/props.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export default {
2222
},
2323
selected: {
2424
type: Object,
25-
default: null,
25+
default: () => ({}),
26+
},
27+
startYear: {
28+
type: Number,
29+
default: new Date().getFullYear(),
2630
},
2731
fullMonths: {
2832
type: Boolean,

0 commit comments

Comments
 (0)