lib/generators/css_zero/add/templates/app/javascript/controllers/datepicker_controller.js in css-zero-0.0.54 vs lib/generators/css_zero/add/templates/app/javascript/controllers/datepicker_controller.js in css-zero-0.0.55
- old
+ new
@@ -1,7 +1,7 @@
import { Controller } from "@hotwired/stimulus"
-import flatpickr from "flatpickr"
+import flatpickr from "https://cdn.skypack.dev/flatpickr@4.6.13"
export default class extends Controller {
static targets = [ "details" ]
static values = {
type: String,
@@ -28,25 +28,16 @@
get #timeOptions() {
return { dateFormat: "H:i", enableTime: true, noCalendar: true }
}
get #dateTimeOptions() {
- return {
- altInput: true,
- altFormat: this.dateTimeFormatValue,
- dateFormat: "Y-m-d H:i",
- disable: this.disableValue,
- mode: this.modeValue,
- enableTime: true
- }
+ return { ...this.#baseOptions, altFormat: this.dateTimeFormatValue, dateFormat: "Y-m-d H:i", enableTime: true }
}
get #basicOptions() {
- return {
- altInput: true,
- altFormat: this.dateFormatValue,
- dateFormat: "Y-m-d",
- disable: this.disableValue,
- mode: this.modeValue
- }
+ return { ...this.#baseOptions, altFormat: this.dateFormatValue, dateFormat: "Y-m-d" }
}
-}
\ No newline at end of file
+
+ get #baseOptions() {
+ return { altInput: true, disable: this.disableValue, mode: this.modeValue }
+ }
+}