Skip to content

Commit bfa2e25

Browse files
authored
feat/disable_dates (#9)
* temp * feat: disable dates * added disabled * version bump
1 parent e4c2a49 commit bfa2e25

11 files changed

+1401
-1439
lines changed

README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,19 @@ Emits events
8787

8888
## Available props
8989

90-
| Prop | Type | Default | Description |
91-
| :------------- | :------ | :------ | :-------------------------------------------------------------------------------------------------------------------- |
92-
| days | Number | 365 | Number of days to append |
93-
| months | Number | 12 | Numbers of months to append (has precedence over `days` if custom set) |
94-
| years | Number | 0 | Number of years to append and enable year mode (see [Demo](#demo) ) |
95-
| prependedYears | Number | 0 | Number of years to preppend. **Note:** this prop is ignored if years is not set |
96-
| prepended | Number | 1 | Number of month to preppend |
97-
| pastIsDisabled | Boolean | true | Allows the selection of alreay past days and predend the days of `prepended` months |
98-
| fullMonths | Boolean | false | Weither or not to always use complete months (i.e. `days=1` if set to `true` the whole month is going to be appended) |
99-
| accentColor | String | #00008b | Set the accent color (`HEX` or `CSS color names`) |
100-
| lang | String | EN | Language (see available in [Transations](#Translation)) |
90+
| Prop | Type | Default | Description |
91+
| :-------------- | :------ | :------ | :-------------------------------------------------------------------------------------------------------------------- |
92+
| days | Number | 365 | Number of days to append |
93+
| months | Number | 12 | Numbers of months to append (has precedence over `days` if custom set) |
94+
| years | Number | 0 | Number of years to append and enable year mode (see [Demo](#demo) ) |
95+
| prependedYears | Number | 0 | Number of years to preppend. **Note:** this prop is ignored if years is not set |
96+
| prependedMonths | Number | 1 | Number of month to preppend |
97+
| disabledWeekDays| Object | {} | Disable a specific week day by setting it's day number to true. ie. `{0: true}` will disable sundays |
98+
| disabledDates | Array | [] | Disable a specific date. Format of the day should be a string `YYYY-MM-DD` ie. `['2018-01-01']` |
99+
| pastIsDisabled | Boolean | true | Allows the selection of alreay past days and predend the days of `prepended` months |
100+
| fullMonths | Boolean | false | Weither or not to always use complete months (i.e. `days=1` if set to `true` the whole month is going to be appended) |
101+
| accentColor | String | #00008b | Set the accent color (`HEX` or `CSS color names`) |
102+
| lang | String | EN | Language (see available in [Transations](#Translation)) |
101103

102104
## Events
103105

demo/index.html

+16-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ <h1 style="backgroundColor: #00008bb0;"> All default</h1>
99
<div class="container-fluid">
1010
<noyear></noyear>
1111
</div>
12+
<h1 style="backgroundColor: #00bcd4b0;"> Sunday Disabled</h1>
13+
<div class="container-fluid">
14+
<byebyesunday :disabled-week-days="{0:true}" accent-color="#00bcd4"></byebyesunday>
15+
</div>
1216
<h1 style="backgroundColor: #dbde1bb0;"> 18 Full Months </h1>
1317
<div class="container-fluid">
1418
<noyearcustom :days=2 :months=18 :full-months=true accent-color="#dbde1b"></noyearcustom>
1519
</div>
16-
<h1 style="backgroundColor: #f44336b0;"> Year Mode 5 Years </h1>
20+
<h1 style="backgroundColor: #f44336b0;">Year Enabled Next 3 days disabled </h1>
1721
<div class="container-fluid">
18-
<year :years=5 accent-color="#f44336"></year>
22+
<year :years=5 :disabled-dates="[`${y}-${m}-${d + 1}`,`${y}-${m}-${d + 2}`,`${y}-${m}-${d + 3}`]" accent-color="#f44336"></year>
1923
</div>
2024
<h1 style="backgroundColor: #8bc34ab0;"> Past Dates 11 Months</h1>
2125
<div class="container-fluid">
@@ -28,10 +32,20 @@ <h1 style="backgroundColor: #372838b0;"> Past Dates + Year Mode 3 years back 5 a
2832
</div>
2933

3034
<script>
35+
const today = new Date()
36+
3137
new Vue({
38+
data() {
39+
return {
40+
m: today.getMonth(),
41+
d: today.getDate(),
42+
y: today.getFullYear(),
43+
}
44+
},
3245
components: {
3346
noyear: draggableCal,
3447
year: draggableCal,
48+
byebyesunday: draggableCal,
3549
noyearcustom: draggableCal,
3650
pastenabled: draggableCal,
3751
pastenabledyears: draggableCal,

0 commit comments

Comments
 (0)