diff --git a/README.md b/README.md index 6baa7084..50e09d0f 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ See the [component page](http://motss.github.io/jv-datepicker/components/jv-date An custom Polymer element built from scratch to provide a datepicker based on Google's Material Design that is more compelling and rich with features. +### Update (v2.1.0) +Three new features have been added to the element: +- `minDate` (dates that are smaller than the predefined `minDate` will be disabled) +- `maxDate` (dates that are larger than the predefined `maxDate` will be disabled) +- `showLongDate` (to show long date instead of short date. Eg. Fri, May 12 2017) + Example: @@ -25,15 +31,7 @@ Example: `jv-datepicker` provides a regular datepicker element. While `jv-datepicker-dialog` has a `jv-datepicker` being wrapped inside a dialog. -## Event handling -`jv-datepicker` or `jv-datepicker-dialog` will fire an event `format-date` whenever a date is being selected via user interaction and it is one of the ways which user can make use of to retrieve the value of the selected date. - -Example: - - - - -## Generating your own boilerplate code of the compounds +## (Coming soon!) Generating your own boilerplate code of the compounds At the end of the demo, there is a section where user can play around with to generate your own boilerplate code with the attributes provided. diff --git a/bower.json b/bower.json index 6af7d224..d96e1f76 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jv-datepicker", - "version": "2.0.1", + "version": "2.1.0", "authors": [ "motss " ], @@ -28,18 +28,21 @@ "README.md" ], "dependencies": { - "polymer": "Polymer/polymer#^1.1.3", - "iron-media-query": "PolymerElements/iron-media-query#~1.0.2", - "neon-animation": "PolymerElements/neon-animation#~1.0.6", - "paper-checkbox": "PolymerElements/paper-checkbox#~1.0.10", - "paper-dialog": "PolymerElements/paper-dialog#~1.0.1", - "paper-icon-button": "PolymerElements/paper-icon-button#~1.0.3", - "iron-list": "PolymerElements/iron-list#~1.1.5", - "paper-slider": "PolymerElements/paper-slider#~1.0.7", - "test-fixture": "PolymerElements/test-fixture#~1.0.1", - "iron-test-helpers": "PolymerElements/iron-test-helpers#~1.0.6" + "polymer": "Polymer/polymer#^1.2.0", + "iron-list": "PolymerElements/iron-list#~1.1.7", + "iron-selector": "PolymerElements/iron-selector#~1.0.8", + "neon-animation": "PolymerElements/neon-animation#~1.0.9", + "paper-icon-button": "PolymerElements/paper-icon-button#~1.0.6" }, "devDependencies": { - "iron-component-page": "PolymerElements/iron-component-page#^1.0.0" + "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#~1.0.3", + "iron-label": "PolymerElements/iron-label#~1.0.1", + "iron-validator-behavior": "PolymerElements/iron-validator-behavior#~1.0.1", + "paper-button": "PolymerElements/paper-button#~1.0.11", + "paper-checkbox": "PolymerElements/paper-checkbox#~1.1.0", + "paper-dialog": "PolymerElements/paper-dialog#~1.0.3", + "paper-input": "PolymerElements/paper-input#~1.1.4", + "web-component-tester": "^3.4.0" } } diff --git a/datepicker-slide-from-left-animation.html b/datepicker-slide-from-left-animation.html index 05172b53..0601ef84 100644 --- a/datepicker-slide-from-left-animation.html +++ b/datepicker-slide-from-left-animation.html @@ -20,9 +20,11 @@ diff --git a/jv-datepicker-icons.html b/jv-datepicker-icons.html new file mode 100644 index 00000000..6fa5eacd --- /dev/null +++ b/jv-datepicker-icons.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/jv-datepicker-theme.html b/jv-datepicker-theme.html deleted file mode 100644 index 1edcb5a6..00000000 --- a/jv-datepicker-theme.html +++ /dev/null @@ -1,208 +0,0 @@ - - - diff --git a/jv-datepicker.html b/jv-datepicker.html index ee953b61..ab2d63a1 100644 --- a/jv-datepicker.html +++ b/jv-datepicker.html @@ -1,22 +1,19 @@ - - - + + + + + + + + - - - - - - - - - + - + + }, + updateBindDate: function(ev) { + if (this._isSelectedDateConfirmed) { + this._bindSelectedFulldate(this._selectedYear, this._selectedMonth, + this._selectedDate, this._format); + this.set('_isSelectedDateConfirmed', false); + } + }, + // Update date to show long date or short date. + _computeShowLongDate: function(_showLongDate) { + if (_showLongDate) { + var _longDate = new Date(this.date).toString().slice(0, 15); + this.set('date', _longDate.slice(0,3) + ',' + _longDate.slice(3)); + }else { + var _shortDate = new Date(this.date); + this.set('date', [_shortDate.getFullYear(), + ('0' + (_shortDate.getMonth() + 1)).slice(-2), _shortDate.getDate()].join('-')); + } + }, + + }); + +