Skip to content

Commit

Permalink
Explicitly pass current time as now with Flatpickr options
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Dec 26, 2024
1 parent 6118b66 commit b91ea11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/assets/bundle/trestle/admin.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion frontend/js/controllers/flatpickr_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ export default class extends ApplicationController {
get options () {
return {
allowInput: true,
altInput: true
altInput: true,
now: this.now
}
}

get now () {
return new Date()
}

#createClearButton (instance) {
if (this.element.dataset.allowClear) {
const clearButton = document.createElement('button')
Expand Down

0 comments on commit b91ea11

Please sign in to comment.