- Fix sibling months day click gave incorrect date
-
Globals are evil. By trying to make things easy to use, we declared a global
window.DPicker
variable. Since5.0.1
it's not the case anymore and it will be declared aswindow.dpicker
. It's recommended that you use a bundle system though (webpack, rollup, browserify...). -
Plugins are exporting a
function
. Makes things easier to pre-build packages. This means that this won't work anymore:
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/dpicker.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/dpicker.time.min.js"></script>
To get date + time, you should use:
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/dpicker.datetime.min.js"></script>
Or the package with every module:
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/dpicker.datetime.all.js"></script>
- Use browserify instead of gulp
- Use real dom, real dates (nanomorph for diffing and bel
- Use standard
- Get rid of momentjs hard dependency (still required for now)
- Implement a Date Adapter for future libraries support
- Simplify plugins api
- uses immutable
Date
instances internally! [BC]
No more _modules
stuff. Just simple objects creation:
DPicker.renders.closeButton = function renderCloseButton(events, data) {
const button = document.createElement('button')
button.innerText = 'Confirm'
button.type = 'button'
button.classList.add('dpicker-close-button')
button.addEventListener('click', events.hidePicker)
return button
}
DPicker.events.hidePicker = function hidePicker() {
this.display = false
}
- Incremental builds
You can use dpicker.datetime.js
directly. Coming soon builds with date-fns
. Available builds:
dist/dpicker.all.min.js.gz: 7.698 kb
dist/dpicker.arrow-navigation.min.js.gz: 0.9410000000000001 kb
dist/dpicker.core.min.js.gz: 4.892 kb
dist/dpicker.datetime.min.js.gz: 6.947 kb
dist/dpicker.min.js.gz: 5.699 kb
dist/dpicker.modifiers.min.js.gz: 0.58 kb
dist/dpicker.navigation.min.js.gz: 0.6900000000000001 kb
dist/dpicker.time.min.js.gz: 2.08 kb
dist/polyfills.min.js.gz: 4.5200000000000005 kb
- Improve docs (A LOT) https://soyuka.github.io/dpicker thanks to jsdoc2md and docsify
- Build a decent demo using cycle.js
- naming public stuff #33
_events
=> events
_data
=> data
- new getter for
empty
onChange
now has a second argument giving informations about the recent change, for example:
dpicker.onChange = function(data, event) {
console.log('Model changed? %s', event.modelChanged ? 'yes' : 'no')
console.log('DPicker event: %s', event.name)
console.log('DPicker original event: %s', event.event)
}
- Adds an option to enable sibling month days
- Adds an option
concatHoursAndMinutes
to merge hours and minutes in oneselect
- Drop hyperscript library, it's not needed anymore and it's not possible to add a custom one
- An invalid Date doesn't reset the value to the closest correct one, it leaves the choice to the user instead
- A class
.invalid
is added to the input aria-*
attributes are now working
Add touch friendly behavior #20
Drop maquettejs hard dependency (see #1). You can now use your own hyperscript library, for example with mithriljs:
let dpicker = DPicker(label, {
h: mithril,
mount: function(element, toRender) {
mithril.render(element, toRender())
},
redraw: mithril.redraw
})
time-format
renamed to meridiem
isEmpty
renamed empty
Drop previousYear
and futureYear
. Those are replaced by min
and max
:
input[type="date"]
polyfill (#2)- allows to change the months selection on max/min dates