Skip to content

Commit

Permalink
Merge branch 'v3'
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0n committed Mar 5, 2024
2 parents bfb93ff + c324811 commit 1a54ee2
Show file tree
Hide file tree
Showing 40 changed files with 699 additions and 183 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.next
node_modules
package-lock.json
coverage
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

### v3.5.0
* added `fixedHeight` option, allows you to have equal weeks number in every month
* added method `disableDate`, allows you to disabled one or multiple dates with datepicker API
* added prop `disabledDates` - it is a Set which holds all disabled dates
* added possibility to pass `{silent: true}` to `update` and `setCurrentView` methods, [#583](https://github.com/t1m0n/air-datepicker/issues/568)
* changed `update` method - now if you pass `selectedDates` then calendar will keep selected only those dates
* fixed selecting time on same date when `range: true`, [#568](https://github.com/t1m0n/air-datepicker/issues/568)
* fixed date conversion to local date when using strings, e.g `selectDate('2024-03-05')` [#589](https://github.com/t1m0n/air-datepicker/issues/589)
* fixed localization generation, thanks to [hreyeslo](https://github.com/hreyeslo) in [#524](https://github.com/t1m0n/air-datepicker/pull/524)
* fixed type definition for `clear` method, thanks to [ahmetzambak](https://github.com/ahmetzambak) in [#591](https://github.com/t1m0n/air-datepicker/pull/591)
* fixed German translation for "clear", thanks to [pbek](https://github.com/pbek) in [#582](https://github.com/t1m0n/air-datepicker/pull/582)
* added Slovenian locale, thanks to [carliblaz](https://github.com/carliblaz) in [#569](https://github.com/t1m0n/air-datepicker/pull/569)
* added Basque locale, thanks to [ikerib](https://github.com/ikerib) in [#529](https://github.com/t1m0n/air-datepicker/pull/529)
* added Norwegian locale, thanks to [MortenSpjotvoll](https://github.com/MortenSpjotvoll) in [#521](https://github.com/t1m0n/air-datepicker/pull/521)

### v3.4.0
* added new options `onFocus` and `onBeforeSelect` grant you more control over range selection behaviour and more [#526](https://github.com/t1m0n/air-datepicker/issues/526)
* added new method `getViewDates()` allows you to get all dates that should be currently displayed in calendar [#536](https://github.com/t1m0n/air-datepicker/issues/536)
Expand Down
50 changes: 15 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
> :tada: New version released! :tada:
# Air Datepicker

Lightweight, **dependency-free**, fast, customizable datepicker written in pure JavaScript. Works in all modern browsers which supports native css variables.
Expand All @@ -26,6 +24,21 @@ new AirDatepicker('#el' [, options]);

## Recent updates

### v3.5.0
* added `fixedHeight` option, allows you to have equal weeks number in every month
* added method `disableDate`, allows you to disabled one or multiple dates with datepicker API
* added prop `disabledDates` - it is a Set which holds all disabled dates
* added possibility to pass `{silent: true}` to `update` and `setCurrentView` methods, [#583](https://github.com/t1m0n/air-datepicker/issues/568)
* changed `update` method - now if you pass `selectedDates` then calendar will keep selected only those dates
* fixed selecting time on same date when `range: true`, [#568](https://github.com/t1m0n/air-datepicker/issues/568)
* fixed date conversion to local date when using strings, e.g `selectDate('2024-03-05')` [#589](https://github.com/t1m0n/air-datepicker/issues/589)
* fixed localization generation, thanks to [hreyeslo](https://github.com/hreyeslo) in [#524](https://github.com/t1m0n/air-datepicker/pull/524)
* fixed type definition for `clear` method, thanks to [ahmetzambak](https://github.com/ahmetzambak) in [#591](https://github.com/t1m0n/air-datepicker/pull/591)
* fixed German translation for "clear", thanks to [pbek](https://github.com/pbek) in [#582](https://github.com/t1m0n/air-datepicker/pull/582)
* added Slovenian locale, thanks to [carliblaz](https://github.com/carliblaz) in [#569](https://github.com/t1m0n/air-datepicker/pull/569)
* added Basque locale, thanks to [ikerib](https://github.com/ikerib) in [#529](https://github.com/t1m0n/air-datepicker/pull/529)
* added Norwegian locale, thanks to [MortenSpjotvoll](https://github.com/MortenSpjotvoll) in [#521](https://github.com/t1m0n/air-datepicker/pull/521)

### v3.4.0
* added new options `onFocus` and `onBeforeSelect` grant you more control over range selection behaviour and more [#526](https://github.com/t1m0n/air-datepicker/issues/526)
* added new method `getViewDates()` allows you to get all dates that should be currently displayed in calendar [#536](https://github.com/t1m0n/air-datepicker/issues/536)
Expand All @@ -39,39 +52,6 @@ new AirDatepicker('#el' [, options]);
* added handling of optional chaining operator in dist package [#518](https://github.com/t1m0n/air-datepicker/issues/518)
* added Indonesian locale, thanks to [BariqDharmawan](https://github.com/BariqDharmawan), in [#517](https://github.com/t1m0n/air-datepicker/pull/517)

### v3.3.4
* recreate global container if it was removed from DOM [#516](https://github.com/t1m0n/air-datepicker/issues/516)
* added Greek locale, thanks to [sonole](https://github.com/sonole), in [#515](https://github.com/t1m0n/air-datepicker/pull/515)

### v3.3.3
* fixed time format in timepicker body [#512](https://github.com/t1m0n/air-datepicker/issues/512)

### v3.3.2
* fixed day period value, when selecting date while datepicker is not active, [#510](https://github.com/t1m0n/air-datepicker/issues/510)
* fixed German locale, [#511](https://github.com/t1m0n/air-datepicker/issues/511)

### v3.3.1
* added Japanese locale, thanks to [kyong0612](https://github.com/kyong0612), in [#505](https://github.com/t1m0n/air-datepicker/pull/505)
* added Korean locale, thanks to [YankeeTube](https://github.com/YankeeTube), in [#506](https://github.com/t1m0n/air-datepicker/pull/506)

### v3.3.0
* new feature that allow you to add custom attributes via `onRenderCell` [#502](https://github.com/t1m0n/air-datepicker/issues/502), [read docs](https://air-datepicker.com/docs?scrollTo=onRenderCell)
* fixed selecting cell when using custom html with `onRenderCell` option [#502](https://github.com/t1m0n/air-datepicker/issues/502)

### v3.2.1
* added Arabic locale, thanks to [abdo-host](https://github.com/abdo-host) [#497](https://github.com/t1m0n/air-datepicker/pull/497)
* added Italian locale, thanks to [msaltieri](https://github.com/msaltieri) [#498](https://github.com/t1m0n/air-datepicker/pull/498)

### v3.2.0
* added `onClickDayName` option, [#459](https://github.com/t1m0n/air-datepicker/issues/459)
* added `silent` param to `clear` method, [#477](https://github.com/t1m0n/air-datepicker/issues/477)
* added Swedish locale, thanks to [naton](https://github.com/naton) [#207](https://github.com/t1m0n/air-datepicker/pull/207)
* fixed error when trying to call `update` method with `view` parameter on hidden calendar, [#476](https://github.com/t1m0n/air-datepicker/issues/476)
* fixed styles issue with time sliders, [#489](https://github.com/t1m0n/air-datepicker/issues/489)
* fixed English docs description, [#490](https://github.com/t1m0n/air-datepicker/issues/490)
* fixed typings for `formatDate` method, [#491](https://github.com/t1m0n/air-datepicker/issues/491)


## Version 3.0.0 highlights
It is been a while since the last release, a lot of work has been done, and I'm glad to finally present a new version of Air Datepicker.

Expand Down
54 changes: 19 additions & 35 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
> :tada: New version released! :tada:
# Air Datepicker

Lightweight, **dependency-free**, fast, customizable datepicker written in pure JavaScript. Works in all modern browsers which supports native css variables.
Expand All @@ -26,43 +24,29 @@ new AirDatepicker('#el' [, options]);

## Recent updates

### v3.5.0
* added `fixedHeight` option, allows you to have equal weeks number in every month
* added method `disableDate`, allows you to disabled one or multiple dates with datepicker API
* added prop `disabledDates` - it is a Set which holds all disabled dates
* added possibility to pass `{silent: true}` to `update` and `setCurrentView` methods, [#583](https://github.com/t1m0n/air-datepicker/issues/568)
* changed `update` method - now if you pass `selectedDates` here then calendar will keep selected only those dates
* fixed localization generation
* fixed selecting time on same date when `range: true`, [#568](https://github.com/t1m0n/air-datepicker/issues/568)
* fixed date conversion to local date when using strings, e.g `selectDate('2024-03-05')` [#589](https://github.com/t1m0n/air-datepicker/issues/589)

### v3.4.0
* added new options `onFocus` and `onBeforeSelect` grant you more control over range selection behaviour and more [#526](https://github.com/t1m0n/air-datepicker/issues/526)
* added new method `getViewDates()` allows you to get all dates that should be currently displayed in calendar [#536](https://github.com/t1m0n/air-datepicker/issues/536)
* `toggleSelected` now can be a function [#534](https://github.com/t1m0n/air-datepicker/issues/534)
* fixed `clear` method [#546](https://github.com/t1m0n/air-datepicker/issues/546)
* added Bulgarian locale, thanks to [tonytomov](https://github.com/tonytomov), in [#531](https://github.com/t1m0n/air-datepicker/pull/531)
* added Catalan locale, thanks to [joatb](https://github.com/joatb), in [#542](https://github.com/t1m0n/air-datepicker/pull/542)
* added Croatian Locale, thanks to [diomed](https://github.com/diomed), in [#551](https://github.com/t1m0n/air-datepicker/pull/551)

### v3.3.5
* added handling of optional chaining operator in dist package [#518](https://github.com/t1m0n/air-datepicker/issues/518)
* added Indonesian locale, thanks to [BariqDharmawan](https://github.com/BariqDharmawan), in [#517](https://github.com/t1m0n/air-datepicker/pull/517)

### v3.3.4
* recreate global container if it was removed from DOM [#516](https://github.com/t1m0n/air-datepicker/issues/516)
* added Greek locale, thanks to [sonole](https://github.com/sonole), in [#515](https://github.com/t1m0n/air-datepicker/pull/515)

### v3.3.3
* fixed time format in timepicker body [#512](https://github.com/t1m0n/air-datepicker/issues/512)

### v3.3.2
* fixed day period value, when selecting date while datepicker is not active, [#510](https://github.com/t1m0n/air-datepicker/issues/510)
* fixed German locale, [#511](https://github.com/t1m0n/air-datepicker/issues/511)

### v3.3.1
* added Japanese locale, thanks to [kyong0612](https://github.com/kyong0612), in [#505](https://github.com/t1m0n/air-datepicker/pull/505)
* added Korean locale, thanks to [YankeeTube](https://github.com/YankeeTube), in [#506](https://github.com/t1m0n/air-datepicker/pull/506)

### v3.3.0
* new feature that allow you to add custom attributes via `onRenderCell` [#502](https://github.com/t1m0n/air-datepicker/issues/502), [read docs](https://air-datepicker.com/docs?scrollTo=onRenderCell)
* fixed selecting cell when using custom html with `onRenderCell` option [#502](https://github.com/t1m0n/air-datepicker/issues/502)

### v3.2.1
* added Arabic locale, thanks to [abdo-host](https://github.com/abdo-host) [#497](https://github.com/t1m0n/air-datepicker/pull/497)
* added Italian locale, thanks to [msaltieri](https://github.com/msaltieri) [#498](https://github.com/t1m0n/air-datepicker/pull/498)

### v3.2.0
* added `onClickDayName` option, [#459](https://github.com/t1m0n/air-datepicker/issues/459)
* added `silent` param to `clear` method, [#477](https://github.com/t1m0n/air-datepicker/issues/477)
* added Swedish locale, thanks to [naton](https://github.com/naton) [#207](https://github.com/t1m0n/air-datepicker/pull/207)
* fixed error when trying to call `update` method with `view` parameter on hidden calendar, [#476](https://github.com/t1m0n/air-datepicker/issues/476)
* fixed styles issue with time sliders, [#489](https://github.com/t1m0n/air-datepicker/issues/489)
* fixed English docs description, [#490](https://github.com/t1m0n/air-datepicker/issues/490)
* fixed typings for `formatDate` method, [#491](https://github.com/t1m0n/air-datepicker/issues/491)


## Version 3.0.0 highlights
It is been a while since the last release, a lot of work has been done, and I'm glad to finally present a new version of Air Datepicker.

Expand Down
10 changes: 7 additions & 3 deletions dist/air-datepicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export declare type AirDatepickerOptions<E extends HTMLElement = HTMLInputElemen
maxMinutes?: number,
hoursStep?: number,
minutesStep?: number,
fixedHeight?: boolean,

onSelect?: ({date, formattedDate, datepicker}: {date: Date | Date[], formattedDate: string | string[], datepicker: AirDatepicker<E>}) => void,
onChangeViewDate?: ({month, year, decade}: {month: number, year: number, decade: AirDatepickerDecade}) => void,
Expand Down Expand Up @@ -128,15 +129,17 @@ declare class AirDatepicker<E extends HTMLElement = HTMLInputElement> {
prev: () => void
selectDate: (date: AirDatepickerDate | AirDatepickerDate[], opts?: {updateTime?: boolean, silent?: boolean}) => void
unselectDate: (date: AirDatepickerDate) => void
clear: () => void
clear: (opts?: {silent?: boolean}) => void
formatDate: (date: AirDatepickerDate, format: string) => string
destroy: () => void
update: (newOpts?: AirDatepickerOptions) => void
setCurrentView: (newView: AirDatepickerViews) => void
update: (newOpts?: AirDatepickerOptions, params?: {silent?: boolean}) => void
setCurrentView: (newView: AirDatepickerViews, params?: {silent?: boolean}) => void
setViewDate: (newViewDate: AirDatepickerDate) => void
setFocusDate: (date: AirDatepickerDate | false, opts?: {viewDateTransition?: boolean}) => void
up: (date?: AirDatepickerDate) => void
down: (date?: AirDatepickerDate) => void
disableDate: (date: AirDatepickerDate | AirDatepickerDate[]) => void
enableDate: (date: AirDatepickerDate | AirDatepickerDate[]) => void

$el: E
$datepicker: HTMLDivElement
Expand All @@ -145,6 +148,7 @@ declare class AirDatepicker<E extends HTMLElement = HTMLInputElement> {
selectedDates: Date[]
focusDate: Date | false
visible: boolean
disabledDates: Set<string>
}


Expand Down
2 changes: 1 addition & 1 deletion dist/air-datepicker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/locale/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var _default = {
months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
monthsShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
today: 'Heute',
clear: 'Aufräumen',
clear: 'Löschen',
dateFormat: 'dd.MM.yyyy',
timeFormat: 'HH:mm',
firstDay: 1
Expand Down
6 changes: 6 additions & 0 deletions dist/locale/eu.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module 'air-datepicker/locale/eu' {
import {AirDatepickerLocale} from 'air-datepicker';
const eu: AirDatepickerLocale;

export default eu;
}
19 changes: 19 additions & 0 deletions dist/locale/eu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
days: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata'],
daysShort: ['Iga', 'Ast', 'Asr', 'Asz', 'Ost', 'Osr', 'Lar'],
daysMin: ['Ig', 'As', 'Ar', 'Az', 'Os', 'Or', 'La'],
months: ['Urtarrila', 'Otsaila', 'Martxoa', 'Apirila', 'Maiatza', 'Ekaina', 'Uztaila', 'Abuztua', 'Iraila', 'Urria', 'Azaroa', 'Abendua'],
monthsShort: ['Urt', 'Ots', 'Mar', 'Api', 'Mai', 'Eka', 'Uzt', 'Abu', 'Ira', 'Urr', 'Aza', 'Abe'],
today: 'Gaur',
clear: 'Garbitu',
dateFormat: 'dd/MM/yyyy',
timeFormat: 'hh:mm aa',
firstDay: 1
};
exports.default = _default;
6 changes: 6 additions & 0 deletions dist/locale/nb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module 'air-datepicker/locale/nb' {
import {AirDatepickerLocale} from 'air-datepicker';
const nb: AirDatepickerLocale;

export default nb;
}
19 changes: 19 additions & 0 deletions dist/locale/nb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"],
daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø"],
months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
today: "Idag",
clear: "Fjern",
dateFormat: "dd.mm.yyyy",
timeFormat: "HH:mm",
firstDay: 1
};
exports.default = _default;
4 changes: 2 additions & 2 deletions dist/locale/pt-BR.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare module 'air-datepicker/locale/pt-BR' {
import {AirDatepickerLocale} from 'air-datepicker';
const pt-BR: AirDatepickerLocale;
const ptBr: AirDatepickerLocale;

export default pt-BR;
export default ptBr;
}
6 changes: 6 additions & 0 deletions dist/locale/sl.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module 'air-datepicker/locale/sl' {
import {AirDatepickerLocale} from 'air-datepicker';
const sl: AirDatepickerLocale;

export default sl;
}
19 changes: 19 additions & 0 deletions dist/locale/sl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
days: ['Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'Četrtek', 'Petek', 'Sobota'],
daysShort: ['Ned', 'Pon', 'Tor', 'Sre', 'Čet', 'Pet', 'Sob'],
daysMin: ['Ned', 'Pon', 'Tor', 'Sre', 'Čet', 'Pet', 'Sob'],
months: ['Januar', 'Februar', 'Marec', 'April', 'Maj', 'Junij', 'Julij', 'Avgust', 'September', 'Oktober', 'November', 'December'],
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'],
today: 'Danes',
clear: 'Počisti',
dateFormat: 'dd.mm.yyyy',
timeFormat: 'hh:ii aa',
firstDay: 1
};
exports.default = _default;
7 changes: 5 additions & 2 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "air-datepicker",
"version": "3.4.0",
"version": "3.5.0",
"scripts": {
"dev": "set NODE_ENV=development&& webpack",
"dev:serve": "npm run browser&& set NODE_ENV=development&& webpack serve",
Expand All @@ -20,6 +20,7 @@
"@babel/preset-env": "^7.20.2",
"@popperjs/core": "^2.10.2",
"@testing-library/jest-dom": "^5.16.1",
"@types/lodash": "^4.14.191",
"animejs": "^3.2.1",
"autoprefixer": "^10.4.13",
"babel-eslint": "^10.1.0",
Expand All @@ -32,7 +33,9 @@
"express": "^4.17.1",
"glob": "^7.1.7",
"html-webpack-plugin": "^5.3.1",
"jest": "^26.6.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^1.6.0",
"node-gzip": "^1.1.2",
"open-cli": "^6.0.1",
Expand Down
Loading

0 comments on commit 1a54ee2

Please sign in to comment.