-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
762 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare module 'air-datepicker/locale/bg' { | ||
import {AirDatepickerLocale} from 'air-datepicker'; | ||
const bg: AirDatepickerLocale; | ||
|
||
export default bg; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"], | ||
daysShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб"], | ||
daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"], | ||
months: ["Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"], | ||
monthsShort: ["Яну", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Ное", "Дек"], | ||
today: "Днес", | ||
clear: "Изчисти", | ||
dateFormat: "dd.MM.yyyy", | ||
timeFormat: 'HH:mm', | ||
firstDay: 1 | ||
}; | ||
exports.default = _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare module 'air-datepicker/locale/ca' { | ||
import {AirDatepickerLocale} from 'air-datepicker'; | ||
const ca: AirDatepickerLocale; | ||
|
||
export default ca; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], | ||
daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis"], | ||
daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds"], | ||
months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], | ||
monthsShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], | ||
today: "Avui", | ||
clear: 'Neteja', | ||
dateFormat: 'dd/MM/yyyy', | ||
timeFormat: 'hh:mm aa', | ||
firstDay: 1 | ||
}; | ||
exports.default = _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare module 'air-datepicker/locale/hr' { | ||
import {AirDatepickerLocale} from 'air-datepicker'; | ||
const hr: AirDatepickerLocale; | ||
|
||
export default hr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ['Nedjelja', 'Ponedjeljak', 'Utorak', 'Srijeda', 'Četvrtak', 'Petak', 'Subota'], | ||
daysShort: ['Ned', 'Pon', 'Uto', 'Sri', 'Čet', 'Pet', 'Sub'], | ||
daysMin: ['Ne', 'Po', 'Ut', 'Sr', 'Če', 'Pe', 'Su'], | ||
months: ['Siječanj', 'Veljača', 'Ožujak', 'Travanj', 'Svibanj', 'Lipanj', 'Srpanj', 'Kolovoz', 'Rujan', 'Listopad', 'Studeni', 'Prosinac'], | ||
monthsShort: ['Sij', 'Velj', 'Ožu', 'Tra', 'Svi', 'Lip', 'Srp', 'Kol', 'Ruj', 'Lis', 'Stu', 'Pro'], | ||
today: 'Danas', | ||
clear: 'Očisti', | ||
dateFormat: 'dd.MM.yyyy', | ||
timeFormat: 'HH:mm', | ||
firstDay: 1 | ||
}; | ||
exports.default = _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
export const disabledRangeDateExample = (msg) => | ||
`import AirDatepicker from 'air-datepicker'; | ||
import isWithinInterval from 'date-fns/isWithinInterval'; | ||
import isEqual from 'date-fns/isEqual'; | ||
const disabledDate = new Date('2023-07-13T00:00:00'); | ||
// ${msg.exampleRangeDisabledComment} | ||
const isDisabledDateIsInRange = ({date, datepicker}) => { | ||
const selectedDate = datepicker.selectedDates[0]; | ||
if (selectedDate && datepicker.selectedDates.length === 1) { | ||
const sortedDates = [selectedDate, date].toSorted((a, b) => { | ||
if (a.getTime() > b.getTime()) { | ||
return 1; | ||
} | ||
return -1; | ||
}) | ||
return (isWithinInterval(disabledDate, { | ||
start: sortedDates[0], | ||
end: sortedDates[1] | ||
})) | ||
} | ||
} | ||
new AirDatepicker('#el', { | ||
startDate: '2023-07-19', | ||
range: true, | ||
onBeforeSelect: ({date, datepicker}) => { | ||
// ${msg.exampleRangeDisabledComment2} | ||
return !isDisabledDateIsInRange({date, datepicker}); | ||
}, | ||
onFocus: ({date, datepicker}) => { | ||
if (isDisabledDateIsInRange({date, datepicker}) || isEqual(date, disabledDate)) { | ||
datepicker.$datepicker.classList.add('-disabled-range-') | ||
} else { | ||
datepicker.$datepicker.classList.remove('-disabled-range-') | ||
} | ||
} | ||
onRenderCell: ({date}) => { | ||
if (date.toLocaleDateString() === disabledDate.toLocaleDateString()) { | ||
return { | ||
disabled: true | ||
} | ||
} | ||
}} | ||
}); | ||
` | ||
|
||
|
||
export const disabledRangeDateExampleCSS = | ||
` | ||
.air-datepicker.-disabled-range- { | ||
--adp-cell-background-color-in-range: #eeeeee; | ||
--adp-cell-background-color-selected: #d0d0d0; | ||
} | ||
` |
Oops, something went wrong.
bfb93ff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
air-datepicker – ./
air-datepicker-t1m0n.vercel.app
air-datepicker.com
air-datepicker-git-master-t1m0n.vercel.app
www.air-datepicker.com