From c8904d062092364c2672deda2e93aebd38920b1f Mon Sep 17 00:00:00 2001 From: Ramiro Rikkert Date: Wed, 4 Feb 2015 11:00:16 +0000 Subject: [PATCH 01/12] Add 1.3.1 --- CHANGELOG.md | 4 ++++ bower.json | 2 +- component.json | 2 +- package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcdc0ac0..52dee03b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.3.1 - 2015-02-04 + +- Fix for bug introduced in #166; fixes #224, #230 + ## 1.3.0 - 2015-01-09 - Fix #79 moving through months can cause calendar to "bounce around" diff --git a/bower.json b/bower.json index 4227e136..7adf3643 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pikaday", - "version": "1.3.0", + "version": "1.3.1", "description": "A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS", "keywords": [ "datepicker", diff --git a/component.json b/component.json index 77fa5e4f..acad0aa0 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "pikaday", "repo": "dbushell/Pikaday", "description": "A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS", - "version": "1.3.0", + "version": "1.3.1", "keywords": [ "datepicker", "calendar", diff --git a/package.json b/package.json index ffbab9ad..e24bd4e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pikaday", - "version": "1.3.0", + "version": "1.3.1", "description": "A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS", "keywords": [ "datepicker", From 37ce1dd14b3b2324c6d663cbc5addacbd9fd17ce Mon Sep 17 00:00:00 2001 From: Tom Cunningham Date: Wed, 4 Feb 2015 08:33:57 -0600 Subject: [PATCH 02/12] Adding themeClass option. * Accepts a string; returns null otherwise * Adds the classname to the 'pika-single' element * Classname can then be used in a stylesheet to theme the datepicker --- pikaday.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pikaday.js b/pikaday.js index 2df75bdc..6bdd2788 100644 --- a/pikaday.js +++ b/pikaday.js @@ -240,6 +240,9 @@ weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] }, + // Theme Classname + themeClass: null, + // callback function onSelect: null, onOpen: null, @@ -483,7 +486,7 @@ } } while ((pEl = pEl.parentNode)); - + if (!self._c) { self._b = sto(function() { self.hide(); @@ -518,7 +521,7 @@ }; self.el = document.createElement('div'); - self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : ''); + self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.themeClass ? ' ' + opts.themeClass : ''); addEvent(self.el, 'mousedown', self._onMouseDown, true); addEvent(self.el, 'change', self._onChange); @@ -588,6 +591,8 @@ opts.field = (opts.field && opts.field.nodeName) ? opts.field : null; + opts.themeClass = (typeof opts.themeClass === 'string' && opts.themeClass) ? opts.themeClass : null; + opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field); opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field; From 31fa12cba87c5748bc957705b85d07f5a24063a7 Mon Sep 17 00:00:00 2001 From: Tom Cunningham Date: Wed, 4 Feb 2015 08:53:00 -0600 Subject: [PATCH 03/12] Creating SCSS option. * Converting CSS to SCSS syntax; nesting styles when appropriate * Removing '@charset'; Sass compiler should add this to the output --- scss/pikaday.scss | 199 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 scss/pikaday.scss diff --git a/scss/pikaday.scss b/scss/pikaday.scss new file mode 100644 index 00000000..a14eb7ad --- /dev/null +++ b/scss/pikaday.scss @@ -0,0 +1,199 @@ +/*! + * Pikaday + * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/ + */ + +.pika-single { + z-index: 9999; + display: block; + position: relative; + color: #333; + background: #fff; + border: 1px solid #ccc; + border-bottom-color: #bbb; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + + &.is-hidden { + display: none; + } + + &.is-bound { + position: absolute; + box-shadow: 0 5px 15px -5px rgba(0,0,0,.5); + } +} + +// clear child float (pika-lendar), using the famous micro clearfix hack +// http://nicolasgallagher.com/micro-clearfix-hack/ +.pika-single { + *zoom: 1; + + &:before, + &:after { + content: " "; + display: table; + } + + &:after { clear: both } +} + +.pika-lendar { + float: left; + width: 240px; + margin: 8px; +} + +.pika-title { + position: relative; + text-align: center; + + select { + cursor: pointer; + position: absolute; + z-index: 9998; + margin: 0; + left: 0; + top: 5px; + filter: alpha(opacity=0); + opacity: 0; + } +} + +.pika-label { + display: inline-block; + *display: inline; + position: relative; + z-index: 9999; + overflow: hidden; + margin: 0; + padding: 5px 3px; + font-size: 14px; + line-height: 20px; + font-weight: bold; + background-color: #fff; +} + +.pika-prev, +.pika-next { + display: block; + cursor: pointer; + position: relative; + outline: none; + border: 0; + padding: 0; + width: 20px; + height: 30px; + text-indent: 20px; // hide text using text-indent trick, using width value (it's enough) + white-space: nowrap; + overflow: hidden; + background-color: transparent; + background-position: center center; + background-repeat: no-repeat; + background-size: 75% 75%; + opacity: .5; + *position: absolute; + *top: 0; + + &:hover { + opacity: 1; + } + + &.is-disabled { + cursor: default; + opacity: .2; + } +} + +.pika-prev, +.is-rtl .pika-next { + float: left; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=='); + *left: 0; +} + +.pika-next, +.is-rtl .pika-prev { + float: right; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII='); + *right: 0; +} + +.pika-select { + display: inline-block; + *display: inline; +} + +.pika-table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 0; + + th, + td { + width: 14.285714285714286%; + padding: 0; + } + + th { + color: #999; + font-size: 12px; + line-height: 25px; + font-weight: bold; + text-align: center; + } + + abbr { + border-bottom: none; + cursor: help; + } +} + +.pika-button { + cursor: pointer; + display: block; + -moz-box-sizing: border-box; + box-sizing: border-box; + outline: none; + border: 0; + margin: 0; + width: 100%; + padding: 5px; + color: #666; + font-size: 12px; + line-height: 15px; + text-align: right; + background: #f5f5f5; + + .is-today & { + color: #33aaff; + font-weight: bold; + } + + .is-selected & { + color: #fff; + font-weight: bold; + background: #33aaff; + box-shadow: inset 0 1px 3px #178fe5; + border-radius: 3px; + } + + .is-disabled & { + pointer-events: none; + cursor: default; + color: #999; + opacity: .3; + } + + &:hover { + color: #fff !important; + background: #ff8000 !important; + box-shadow: none !important; + border-radius: 3px !important; + } +} + +.pika-week { + font-size: 11px; + color: #999; +} From f23d6561ac6860b7c2fa6559ddccfc8f9d1b22e9 Mon Sep 17 00:00:00 2001 From: Tom Cunningham Date: Sat, 14 Feb 2015 08:58:21 -0600 Subject: [PATCH 04/12] Updating README with description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 08033003..c8ae0860 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ Pikaday has many useful options: * `showMonthAfterYear` render the month after year in the title (default `false`) * `numberOfMonths` number of visible calendars * `mainCalendar` when `numberOfMonths` is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`). Only used for the first display or when a selected date is not already visible +* `themeClass` define a classname that can be used as a hook for styling different themes * `onSelect` callback function for when a date is selected * `onOpen` callback function for when the picker becomes visible * `onClose` callback function for when the picker is hidden From 7674f9f6cc681fbf8520dafe94adf90902930d4e Mon Sep 17 00:00:00 2001 From: Ramiro Rikkert Date: Tue, 17 Feb 2015 15:48:38 +0000 Subject: [PATCH 05/12] Release and publish 1.3.2 --- CHANGELOG.md | 4 ++++ bower.json | 2 +- component.json | 2 +- package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db4114e9..88351abc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ ## 1.4.0 - TBA + +## 1.3.2 - 2015-02-17 + - Add options to disable days, see #171 +- Add SCSS file, see #130 ## 1.3.1 - 2015-02-04 diff --git a/bower.json b/bower.json index 7adf3643..a31b682d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pikaday", - "version": "1.3.1", + "version": "1.3.2", "description": "A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS", "keywords": [ "datepicker", diff --git a/component.json b/component.json index acad0aa0..50a281cb 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "pikaday", "repo": "dbushell/Pikaday", "description": "A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS", - "version": "1.3.1", + "version": "1.3.2", "keywords": [ "datepicker", "calendar", diff --git a/package.json b/package.json index e24bd4e6..0d1e17c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pikaday", - "version": "1.3.1", + "version": "1.3.2", "description": "A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS", "keywords": [ "datepicker", From 32d7c136ae8b8ae010fb1db28988ff424081217d Mon Sep 17 00:00:00 2001 From: Stuart Bennett Date: Tue, 17 Feb 2015 22:55:57 +0000 Subject: [PATCH 06/12] Initial Test --- tests/methods.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/methods.js b/tests/methods.js index 65f69a83..9d90e702 100644 --- a/tests/methods.js +++ b/tests/methods.js @@ -23,4 +23,15 @@ describe('Pikaday public method', function () expect(pikaday.toString()).to.eql('25-04-14'); }); }); -}); \ No newline at end of file + + describe('#setMinDate()', function () { + it('should flatten date to midnight ignoring time portion (consistent with minDate option in ctor)', function () { + var date = new Date(2015, 1, 17, 22, 10, 5), + expected = new Date(2015, 1, 17, 0, 0, 0), + pikaday = new Pikaday(); + + pikaday.setMinDate(date); + expect(pikaday._o.minDate).to.eql(expected); + }); + }); +}); From 0d75902bb3b020a0100e3fb6858de3a017902356 Mon Sep 17 00:00:00 2001 From: Stuart Bennett Date: Tue, 17 Feb 2015 23:11:39 +0000 Subject: [PATCH 07/12] Move ctor min date assignment to setMinDate keeping behaviour consistent with public setMinDate call --- pikaday.js | 9 +++++---- tests/methods.js | 10 ++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pikaday.js b/pikaday.js index fd468ddb..1ad41fb5 100644 --- a/pikaday.js +++ b/pikaday.js @@ -489,7 +489,7 @@ } } while ((pEl = pEl.parentNode)); - + if (!self._c) { self._b = sto(function() { self.hide(); @@ -615,9 +615,7 @@ opts.maxDate = opts.minDate = false; } if (opts.minDate) { - setToStartOfDay(opts.minDate); - opts.minYear = opts.minDate.getFullYear(); - opts.minMonth = opts.minDate.getMonth(); + this.setMinDate(opts.minDate) } if (opts.maxDate) { setToStartOfDay(opts.maxDate); @@ -807,6 +805,9 @@ setMinDate: function(value) { this._o.minDate = value; + setToStartOfDay(value); + this._o.minYear = value.getFullYear(); + this._o.minMonth = value.getMonth(); }, /** diff --git a/tests/methods.js b/tests/methods.js index 9d90e702..e8871f00 100644 --- a/tests/methods.js +++ b/tests/methods.js @@ -24,6 +24,16 @@ describe('Pikaday public method', function () }); }); + describe('When specifying minDate option in Constructor', function () { + it('Should remove the time portion (flattening to midnight)', function () { + var date = new Date(2015, 1, 17, 22, 10, 5), + expected = new Date(2015, 1, 17, 0, 0, 0), + pikaday = new Pikaday({ minDate: date }); + + expect(pikaday._o.minDate).to.eql(expected); + }); + }); + describe('#setMinDate()', function () { it('should flatten date to midnight ignoring time portion (consistent with minDate option in ctor)', function () { var date = new Date(2015, 1, 17, 22, 10, 5), From c0ed319c3b38a4495d0db0399bdcef730c7393b5 Mon Sep 17 00:00:00 2001 From: Stuart Bennett Date: Tue, 17 Feb 2015 23:18:02 +0000 Subject: [PATCH 08/12] Re-order method calls --- pikaday.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pikaday.js b/pikaday.js index 1ad41fb5..c3373efa 100644 --- a/pikaday.js +++ b/pikaday.js @@ -804,10 +804,10 @@ */ setMinDate: function(value) { - this._o.minDate = value; setToStartOfDay(value); + this._o.minDate = value; this._o.minYear = value.getFullYear(); - this._o.minMonth = value.getMonth(); + this._o.minMonth = value.getMonth(); }, /** From 1b53c9cd5a657e657dfb8ca49ebcb3bb0a095f0d Mon Sep 17 00:00:00 2001 From: Tom Cunningham Date: Tue, 17 Feb 2015 21:08:58 -0600 Subject: [PATCH 09/12] Adding theme example. * Creating HTML file for theme example * Creating example theme stylesheet * Updating README with link to example --- README.md | 3 ++- css/theme.css | 56 +++++++++++++++++++++++++++++++++++++++++++++ examples/theme.html | 50 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 css/theme.css create mode 100644 examples/theme.html diff --git a/README.md b/README.md index 4b3a78e4..44eba492 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Pikaday has many useful options: * `showMonthAfterYear` render the month after year in the title (default `false`) * `numberOfMonths` number of visible calendars * `mainCalendar` when `numberOfMonths` is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`). Only used for the first display or when a selected date is not already visible -* `themeClass` define a classname that can be used as a hook for styling different themes +* `themeClass` define a classname that can be used as a hook for styling different themes, see [theme example][] * `onSelect` callback function for when a date is selected * `onOpen` callback function for when the picker becomes visible * `onClose` callback function for when the picker is hidden @@ -320,3 +320,4 @@ Copyright © 2014 David Bushell | BSD & MIT license [trigger example]: http://dbushell.github.com/Pikaday/examples/trigger.html "Pikaday using custom trigger" [positions example]: http://dbushell.github.com/Pikaday/examples/positions.html "Pikaday using different position options" [container example]: http://dbushell.github.com/Pikaday/examples/container.html "Pikaday using custom calendar container" + [theme example]: http://dbushell.github.com/Pikaday/examples/theme.html "Pikaday using multiple themes" diff --git a/css/theme.css b/css/theme.css new file mode 100644 index 00000000..3a0c1013 --- /dev/null +++ b/css/theme.css @@ -0,0 +1,56 @@ +/** + * This theme is an example to show how you can create your own. + */ +.pika-single.dark-theme { + color: #fff; + background: #333; + border: 1px solid #666; + border-bottom-color: #999; +} + +.dark-theme .pika-label { + background-color: #333; +} + +.dark-theme .pika-prev, +.dark-theme .is-rtl .pika-next { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAQAAACGG/bgAAAAQ0lEQVR4Ae3KIQ4AIBTD0N0/IeHGI3UIRA3ut/Zl+ltXc5++htVAmIAwAWECwgSEKbgthEoIlRAqIVRCqINQB9nDgQd7ktwFo6UpWQAAAABJRU5ErkJggg=='); +} + +.dark-theme .pika-next, +.dark-theme .is-rtl .pika-prev { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAQAAACGG/bgAAAAP0lEQVQ4y+3TMQoAMAgEwfwfAvvjTZ1uGzuvHhBPPGczEG+FRqqRaqQaqUaqkX6QBmmjacvQ6qEVTjsh+xizebvlaWptGXZAAAAAAElFTkSuQmCC'); +} + +.dark-theme .pika-table th { + color: #999; +} + +.dark-theme .pika-button { + color: #fff; + background: #222; +} + +.dark-theme .pika-week { + color: #999; +} + +.dark-theme .is-today .pika-button { + color: #33aaff; +} + +.dark-theme .is-selected .pika-button { + color: #fff; + background: #33aaff; + box-shadow: inset 0 1px 3px #178fe5; +} + +.dark-theme .is-disabled .pika-button { + color: #999; + opacity: .3; +} + +.dark-theme .pika-button:hover { + color: #fff !important; + background: #ff8000 !important; +} diff --git a/examples/theme.html b/examples/theme.html new file mode 100644 index 00000000..b5b3ffb0 --- /dev/null +++ b/examples/theme.html @@ -0,0 +1,50 @@ + + + + + + Pikaday - Theme example + + + + + + + Fork me on GitHub + +

Pikaday - Theme example

+ +

A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS.

+ + +
+ No theme +
+ Custom theme + +

What is this?

+ +

Since version 1.0 Pikaday is a stable and battle tested date-picker. Feel free to use it however you like but please report any bugs or feature requests to the GitHub issue tracker, thanks!

+ +

Copyright © 2014 David Bushell | BSD & MIT license | Example by Ramiro Rikkert

+ + + + + + + From b31c8f804308adc0c91fbde19208a3be8209b0d3 Mon Sep 17 00:00:00 2001 From: Ramiro Rikkert Date: Wed, 18 Feb 2015 07:33:46 +0000 Subject: [PATCH 10/12] Rename themeClass to theme. --- CHANGELOG.md | 1 + README.md | 2 +- examples/theme.html | 4 ++-- pikaday.js | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88351abc..3b9dbaae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.4.0 - TBA +- Add theme class support, see #260 ## 1.3.2 - 2015-02-17 diff --git a/README.md b/README.md index 44eba492..6e4b89df 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Pikaday has many useful options: * `showMonthAfterYear` render the month after year in the title (default `false`) * `numberOfMonths` number of visible calendars * `mainCalendar` when `numberOfMonths` is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`). Only used for the first display or when a selected date is not already visible -* `themeClass` define a classname that can be used as a hook for styling different themes, see [theme example][] +* `theme` define a classname that can be used as a hook for styling different themes, see [theme example][] (default `null`) * `onSelect` callback function for when a date is selected * `onOpen` callback function for when the picker becomes visible * `onClose` callback function for when the picker is hidden diff --git a/examples/theme.html b/examples/theme.html index b5b3ffb0..2b9add48 100644 --- a/examples/theme.html +++ b/examples/theme.html @@ -33,7 +33,7 @@

What is this?

diff --git a/pikaday.js b/pikaday.js index 4d14c6d2..193174a8 100644 --- a/pikaday.js +++ b/pikaday.js @@ -247,7 +247,7 @@ }, // Theme Classname - themeClass: null, + theme: null, // callback function onSelect: null, @@ -527,7 +527,7 @@ }; self.el = document.createElement('div'); - self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.themeClass ? ' ' + opts.themeClass : ''); + self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : ''); addEvent(self.el, 'mousedown', self._onMouseDown, true); addEvent(self.el, 'change', self._onChange); @@ -597,7 +597,7 @@ opts.field = (opts.field && opts.field.nodeName) ? opts.field : null; - opts.themeClass = (typeof opts.themeClass === 'string' && opts.themeClass) ? opts.themeClass : null; + opts.theme = (typeof opts.theme) == 'string' && opts.theme ? opts.theme : null; opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field); From c4c9037767759ca7cccbf3b43cd8205cd560319b Mon Sep 17 00:00:00 2001 From: Ramiro Rikkert Date: Wed, 18 Feb 2015 09:00:20 +0000 Subject: [PATCH 11/12] Add touch support, fixes #101. --- CHANGELOG.md | 1 + pikaday.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9dbaae..654bf295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.4.0 - TBA - Add theme class support, see #260 +- Fix on iOS, see #101 ## 1.3.2 - 2015-02-17 diff --git a/pikaday.js b/pikaday.js index 193174a8..5503309f 100644 --- a/pikaday.js +++ b/pikaday.js @@ -529,7 +529,7 @@ self.el = document.createElement('div'); self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : ''); - addEvent(self.el, 'mousedown', self._onMouseDown, true); + addEvent(self.el, 'ontouchend' in document ? 'ontouchend' : 'mousedown', self._onMouseDown, true); addEvent(self.el, 'change', self._onChange); if (opts.field) { From 493024d6e5f6cb0112d89948af81334c8f438c88 Mon Sep 17 00:00:00 2001 From: Ramiro Rikkert Date: Wed, 18 Feb 2015 09:02:45 +0000 Subject: [PATCH 12/12] Add preventDefault fixes #249. --- CHANGELOG.md | 1 + pikaday.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 654bf295..c24e81e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Add theme class support, see #260 - Fix on iOS, see #101 +- Fix #249 ## 1.3.2 - 2015-02-17 diff --git a/pikaday.js b/pikaday.js index 5503309f..ca3570d6 100644 --- a/pikaday.js +++ b/pikaday.js @@ -405,6 +405,7 @@ return; } + e.preventDefault(); if (!hasClass(target, 'is-disabled')) { if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) { self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));