Loading README.txt +1 −29 Original line number Diff line number Diff line Pikaday Calendar **************** Add the JavaScript to the end of your document: <script src="pikaday.js"></script> <script> var picker = new Pikaday({ field: document.getElementById('datepicker') }); </script> If you're using jQuery make sure to pass only the first element: var picker = new Pikaday({ field: $('#datepicker')[0] }); If the Pikaday instance is not bound to a field you can append the element anywhere: var field = document.getElementById('datepicker'); var picker = new Pikaday({ onSelect: function(date) { field.value = picker.toString(); } }); field.parentNode.insertBefore(picker.el, field.nextSibling); Browser Compatibility ********************* • IE 7+ • Chrome 8+ • Firefox 3.5+ • Safari 3+ • Opera 10.6+ TBA src/Form/pikadaySettingsForm.php +2 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ class PikadaySettingsForm extends ConfigFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { // Retrieve and the configuration. // Retrieve and save the configuration. $this->configFactory->getEditable('pikaday.settings') ->set('pikaday_enable', $form_state->getValue('pikaday_enable')) ->set('pikaday_formids', $form_state->getValue('pikaday_formids')) Loading js/script.js +9 −9 File changed.Contains only whitespace changes. Show changes Loading
README.txt +1 −29 Original line number Diff line number Diff line Pikaday Calendar **************** Add the JavaScript to the end of your document: <script src="pikaday.js"></script> <script> var picker = new Pikaday({ field: document.getElementById('datepicker') }); </script> If you're using jQuery make sure to pass only the first element: var picker = new Pikaday({ field: $('#datepicker')[0] }); If the Pikaday instance is not bound to a field you can append the element anywhere: var field = document.getElementById('datepicker'); var picker = new Pikaday({ onSelect: function(date) { field.value = picker.toString(); } }); field.parentNode.insertBefore(picker.el, field.nextSibling); Browser Compatibility ********************* • IE 7+ • Chrome 8+ • Firefox 3.5+ • Safari 3+ • Opera 10.6+ TBA
src/Form/pikadaySettingsForm.php +2 −2 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ class PikadaySettingsForm extends ConfigFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { // Retrieve and the configuration. // Retrieve and save the configuration. $this->configFactory->getEditable('pikaday.settings') ->set('pikaday_enable', $form_state->getValue('pikaday_enable')) ->set('pikaday_formids', $form_state->getValue('pikaday_formids')) Loading