diff --git a/.eslintrc.js b/.eslintrc.js
index b238d7922..fc7b71e6e 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -43,6 +43,7 @@ module.exports = {
'import/no-duplicates': 'off',
'import/no-webpack-loader-syntax': 'off',
'import/first': 'off',
+ 'import/prefer-default-export': 'off',
'no-console': 'off',
}
}
diff --git a/.gitignore b/.gitignore
index 9b2cb5650..8659a13d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
node_modules/
dist/
lib/
+working/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b996246d..f19bd8f66 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+## 0.4.0
+* Fix weekday labels not always having same exact width
+* Add support for complex attribute dates. Closes #7 and #12.
+* Add support for attribute `excludeDates`, date picker `availableDates`. Closes #19.
+* Add support for endless date ranges using null for start/end dates. Closes #20.
+* Add support for attaching custom data to attributes via `customData` property. Closes #21.
+
+## 0.3.3
+* Fix duplicate input event for inline date picker
+
## 0.3.2
* Fix styling bug introduced by v0.3.1.
diff --git a/README.md b/README.md
index 7b63b42b3..7f3b5e71b 100755
--- a/README.md
+++ b/README.md
@@ -22,6 +22,158 @@ Visit https://vcalendar.netlify.com for demos and API reference. This plug-in is
* Handles taps for date selection
* Handles swipes for month navigation
+# Usage
+
+## Calendar
+
+All attributes for a calendar are supplied within an array.
+
+A single attribute may consist of one of each of the following objects: higlights, dots, bars, content style, content hover style. Supply the attributes as an array for the `v-calendar` component.
+
+Here is an example of a simple highlight with a content style.
+
+```html
+
+
+```
+
+```javascript
+export const {
+ data() {
+ return {
+ attrs: [
+ {
+ highlight: {
+ backgroundColor: 'red',
+ borderRadius: '5px' // Only applied on highlighted end caps
+ },
+ contentStyle: {
+ color: 'white' // Contrasts well with the red background
+ },
+ dates: [
+ new Date(), // Use dates
+ { // ...or date ranges
+ start: new Date('1/21/83'), // ...that start on my birthday :)
+ end: new Date()
+ }
+ ]
+ customData: myData // Custom data to reference later
+ }
+ ]
+ }
+ }
+};
+```
+
+The `dates` array specifies dates for which all components of the attribute appear. As you can see, both date objects and date range objects are allowed, where the latter requires start and end dates when needed. For date ranges, null values are allowed for infinite start and end dates, in which case those properties can be ommitted entirely.
+
+### Date Patterns
+
+One really neat feature is that you can target specific dates from within a parent range. This allows for creating complex date patterns that would be difficult to achieve otherwise.
+
+For a simple example, let's say we want to display an attribute on the weekends. To do that, we configure the date like this:
+
+```javascript
+...
+attrs: [
+ {
+ highlight: {...},
+ contentStyle: {...},
+ dates: [
+ {
+ start: null, // From the beginning of time...
+ end: null, // ...to the end of time...
+ weekdays: [1, 7] // ...on Sundays and Saturdays
+ }
+ ]
+ }
+]
+...
+```
+
+We can also target other specific day properties, like `days: [6, 15]` for the 6th and 15th of the month, `weeks: [-1]` for the last week of the month and even `ordinalWeekdays: { -1: [1] }` for the last Sunday of the month.
+
+If supplying only a single numerical argument, like `weeks: [-1]`, we can nix the array and simplify to `weeks: -1`.
+
+Additionally, if the date is applied over an infinite time scale (`start` and `end` dates are `null`) like the example before, we can remove `start` and `end` completely. And since our date object is the only one in the array, we can nix the array again like before.
+
+```javascript
+...
+attrs: [
+ {
+ highlight: {...},
+ contentStyle: {...},
+ dates: { weekdays: [1, 7] } // Nice and tidy
+ }
+],
+```
+
+Let's consider another simple example of displaying dot indicators on the last Friday of every other month, starting on January 1st of 2018. We could do so like this.
+
+```javascript
+...
+ attrs: [
+ {
+ dot: { backgroundColor: 'red' },
+ dates: {
+ start: new Date('1/1/2018'),
+ monthlyInterval: 2, // Every other month
+ ordinalWeekdays: { [-1]: 6 } // ...on the last Friday
+ }
+ }
+ ]
+...
+```
+
+Now, for some reason, we also want to display them on the 15th of every other month, so our first attempt might be to modify the dates to this:
+
+```javascript
+...
+dates: {
+ start: new Date('1/1/2018'),
+ monthlyInterval: 2, // Every other month
+ ordinalWeekdays: { [-1]: 6 }, // ...on the last Friday
+ days: 15 // ...and on the 15th? (WRONG!)
+},
+...
+```
+
+But this would be **wrong**, because all component specifiers are conditionally *anded* with each other.
+
+To evaluate a set of conditions *or* another set, we can break the sets of conditions out into an array assigned to the `on` property.
+
+```javascript
+...
+dates: {
+ start: new Date('1/1/2018'),
+ monthlyInterval: 2, // Every other month
+ on: [ // ...on...
+ { ordinalWeekdays: { [-1]: 6 } }, // ...the last Friday
+ { days: 15 } // ...or the 15th of the month
+ ]
+}
+...
+```
+
+Note how we kept the `monthlyInterval` condition outside of the others. Any conditions that should be **anded** with all the others can be extracted out of the array. This prevents unnecessary duplication of conditions within **or** subsets.
+
+Here is a complete reference of date component specifiers available.
+
+| Property | Type | Description | Range |
+| --- | --- | --- | --- |
+| `days` | Number, Array | Day number from the start or end of the month. | 1 to 31, -1 to -31 |
+| `weekdays` | Number, Array | Day of the week. | 1: Sun to 7: Sat |
+| `ordinalWeekdays` | Object (key: Number / value: Number, Array) | Weekday ordinal position from the start or end of the month. | key: 1 to 6, -1 to -6 / value: 1: Sun to 7: Sat |
+| `weeks` | Number, Array | Week number from the start or end of the month. | 1 to 6, -1 to -6 |
+| `months` | Number, Array | Months of the year. | 1 to 12 |
+| `years` | Number, Array | Year numbers. | 4-digit integer |
+| `dailyInterval` | Number | Interval number of days from the start date (or today when no start date provided). | n > 0 |
+| `weeklyInterval` | Number | Interval number of weeks from the start date (or today). | n > 0 |
+| `monthlyInterval` | Number | Interval number of months from the start date (or today). | n > 0 |
+| `yearlyInterval` | Number | Interval number of years from the start date (or today). | n > 0 |
+
+
+
## Quick Start
[Vue.js](https://vuejs.org) version 2.4+ is required.
diff --git a/_todos.txt b/_todos.txt
index e1f710b91..8e54f4569 100755
--- a/_todos.txt
+++ b/_todos.txt
@@ -1,5 +1,4 @@
-- Add day-height back as a prop
-- Code copy button does not work
+- Add ordinalWeekday and ordinalWeekdayFromEnd props to dayInfo
CALENDAR
@@ -20,3 +19,9 @@ Day cell overflow problem:
For c-day classes, there is catch with setting overflow: hidden.
If it is set, then sometimes a blank line can appear between day cell highlights.
If it is not set, then transparent backgrounds can interfere with each other during animations.
+
+THOUGHTS:
+
+An attribute date specified as a range may also specify a filter function that slices up that range.
+If a filter function is specified, then a new scanEnd date will need to be calculated using a maxLength
+parameter on the date in order to know when to stop testing for a date match on that attribute.
diff --git a/docs/components/home/examples/ExDatePicker.vue b/docs/components/home/examples/ExDatePicker.vue
index 726ca95c3..8500d9831 100755
--- a/docs/components/home/examples/ExDatePicker.vue
+++ b/docs/components/home/examples/ExDatePicker.vue
@@ -21,20 +21,16 @@
diff --git a/src/components/DatePicker.vue b/src/components/DatePicker.vue
index e784feb5e..d140f0d4d 100755
--- a/src/components/DatePicker.vue
+++ b/src/components/DatePicker.vue
@@ -1,17 +1,12 @@
@@ -27,28 +22,25 @@
@didDisappear='popoverDidDisappear'
v-else>
@@ -58,18 +50,15 @@