Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a basic http-server (using start), build and watch scripts #2

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
16740ad
Make start day of week optional
Dec 30, 2019
a8cc421
Adds a basic `http-server` (using start), build and watch scripts as …
oilee80 Dec 30, 2019
451a58b
Fixing days missing when week starts on Sunday
Dec 31, 2019
7713258
Tweaked so that `displayInColumn: true` works
oilee80 Jan 1, 2020
c77ec78
Add limiting start/end to the calendar
oilee80 Jan 3, 2020
b40729d
potentially fix timezone issue
cesque Feb 25, 2020
ffbfae7
bump version number
cesque Feb 25, 2020
0fa62c0
Removed timezone references
carl-wells-crowdhandler Mar 4, 2020
06c08a9
Porting over in a few of Lees build changes
carl-wells-crowdhandler Mar 4, 2020
d3c1b4e
Adding deb build tools and checking if correct iso dates are being su…
carl-wells-crowdhandler Mar 4, 2020
a2bd16d
Building dist file
carl-wells-crowdhandler Mar 6, 2020
d2380ef
Bumped version and added production env
carl-wells-crowdhandler Mar 6, 2020
7877d65
Add option to disable linear dates
hpatel-mm Mar 21, 2020
ee7e36c
Merge pull request #2 from MadeHQ/non-linear-dates
hpatel-mm Mar 23, 2020
7aaa013
Merge branch 'master' into no-timezone
lbradley-mm Apr 27, 2020
11dfdc3
Add check for `useDefaultTemplate` before replacing `innerHTML` of el…
lbradley-mm Apr 27, 2020
42b73a9
Set the `end` value to be the end of the month
lbradley-mm Apr 30, 2020
fb16e1a
Merge pull request #1 from MadeHQ/no-timezone
djames-mm Jul 23, 2020
89b7bac
fix issue with some dates having wrong availability
djames-mm Jul 23, 2020
8f1645c
add dist file for previous change
djames-mm Jul 30, 2020
c7d866f
start componentisation
vipen-made Feb 15, 2022
899df0b
convert to component
vipen-made Feb 15, 2022
0a6e588
ability to set timezone
vipen-made Feb 15, 2022
4cf2b25
merge fix
vipen-made Feb 16, 2022
5704e49
improve functionality to disallow scrolling outside of date range
vipen-made Feb 16, 2022
bf56824
remove redundant prop
vipen-made Feb 16, 2022
3f35a85
fix available-dates so setAvailable does not need to be called
vipen-made Feb 16, 2022
33b8e34
update readme
vipen-made Feb 16, 2022
37c5e9d
refactoring
vipen-made Feb 16, 2022
d5432af
comments
vipen-made Feb 17, 2022
19499ff
move validation to inside disableScroll function
vipen-made Feb 17, 2022
7aa0b25
better validation
vipen-made Feb 17, 2022
8a65488
Merge pull request #3 from MadeHQ/master_component
vipen-made Feb 17, 2022
996d048
make month scroller buttons disabled/enabled and implement logic for …
vipen-made Feb 17, 2022
26019f6
validation
vipen-made Feb 17, 2022
ca8fa36
Merge pull request #4 from MadeHQ/feature/81376
vipen-made Feb 17, 2022
249b67d
change entry file
vipen-made Mar 28, 2022
bd7127a
Merge pull request #5 from MadeHQ/package-update
vipen-made Mar 28, 2022
3044175
Fixes to Available dates: Shifting the dates off the list caused firs…
lbradley-mm Mar 30, 2022
ff3cc73
Version bump - 1.0.2
lbradley-mm Mar 30, 2022
0531fd1
Merge pull request #6 from MadeHQ/fix/avail-dates
lbradley-mm Mar 31, 2022
239e91e
check for year when comparing months in calendar
mrai-mm Jun 28, 2022
be9e269
Merge pull request #7 from MadeHQ/support/83047
mrai-mm Jun 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,6 @@ typings/
.dynamodb/

# TernJS port file
.tern-port
.tern-port

.DS_Store
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/gallium
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Designed to be used as a Vue component: `Vue.component(element, Calus)` where element is the name of the template i.e. 'calendar-calus'. You can then use:
```html
<calendar-calus inline-template></calendar-calus>
```

### Props
You can pass the following props from the template:
- `time-zone`: defaults to local otherwise can be explicitly set (i.e. Europe/London)
- `available-dates`: list of dates which are available to select (luxon DateTime format)
- `display-in-column`: whether to show all the months in a column, or a single month with controls to change which month is shown
- `linear-dates`: linear view for when showing a free flowing calendar
- `week-starts-on-sunday`: force the day to start on sunday instead of default monday. Accepts true/false
- `on-select`: callback for when an available date is clicked
- `allow-scrolling-outside-of-date-range`: defaults to false, set to true if you want to be able to scroll to months outside of available date range
- `month-controls-classes`: array of classes that control the previous/next month buttons i.e. `['.month__control--prev', '.month__control--next']`. This is used in conjunction with `display-in-column: false` and `allow-scrolling-outside-of-date-range: false` and sets a `disabled` class on the appropriate previous/next button

### Methods
- `select()`: method to call when clicking on a date. Uses function passed into prop `on-select` for logic
- `scrollMonth()`: pass any number (positive or negative) to scrolle forward/previous n months

### Example Template
```html
<calendar-calus
inline-template
:allow-scrolling-outside-of-date-range="false"
time-zone="America/Chicago"
:month-controls-classes="['.month__control--prev', '.month__control--next']"
>
<div class="month-container" v-bind:class="{ 'month-container--column': displayInColumn }">
<div class="month" v-for="month in months" v-bind:data-month="month.time.toFormat('MM/y')">
<div class="month__header">
<button type="button" class="month__control month__control--prev" :disabled="month.disablePrevScroll" v-if="!displayInColumn" v-on:click="scrollMonth(-1)">
</button>
<div class="month__text">
{{ month.time.toFormat(month.isInCurrentYear ? 'MMMM' : 'MMMM y') }}
</div>
<button type="button" class="month__control month__control--next" v-if="!displayInColumn" v-on:click="scrollMonth(1)">
</button>
</div>
<div class="month__days">
<div class="day"
v-for="day in month.days"
v-bind:data-date="+day.time"
v-bind:class="{
'is-today': day.isToday,
'is-not-today': !day.isToday,
'is-available': day.isAvailable,
'is-not-available': !day.isAvailable,
'is-past': day.isPast,
'is-future': day.isFuture,
'is-selected': day.isSelected,
'is-this-month': day.isThisMonth,
'is-different-month': !day.isThisMonth,
}"
v-on:click="select(day)"
>
<div class="day__inner">
{{ day.time.day }}
</div>
</div>
</div>
</div>
</div>
</calendar-calus>
```
Loading