Closed skjalgepalg closed 3 years ago
This PR adds the ability to initialise a datepicker without a value.
timestamp
-attribute has been removed
date
(see below) but logs to console.warn
on initialisation to help identify where migration is necessary.date
-attribute takes any value supported by simple-date-parse
null
the attribute is treated the same as if removed through removeAttribute
.When date
has no value:
null
datepicker.change
eventautofocus
and tabindex
are set to the current dateThe following has been fixed:
data-for
(and deprecated for
) -attributeLeft a couple of comments on the code!
As an aside: The nrk.no team is currently using core-datepicker in at least a couple of apps: https://github.com/nrkno/nrkno-sendeplan and https://github.com/nrkno/nrkno-sportsopplevelse. These apps are currently not in use, as they've been season/event specific so far. When we start using them again, we'll most likely have to make tweaks to the code anyway, so small changes to the datepicker API (e.g. timestamp
being replaced by date
) should be no problem :)
Use
type="button"
in example code in docs Add handler for filling empty input when clicking todays date.Relates to #633