Skip to content

Commit

Permalink
Fix javascript fails to set the hidden value when the remove icon is …
Browse files Browse the repository at this point in the history
…clicked #86
  • Loading branch information
monim67 committed Nov 25, 2022
1 parent 7ac567d commit 08fcfc7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap_datepicker_plus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class WidgetSettings(BaseSettings):
bootstrap_icon_css_url: Optional[
str
] = "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css"
app_static_url = "https://cdn.jsdelivr.net/gh/monim67/django-bootstrap-datepicker-plus@5.0.0/src/bootstrap_datepicker_plus/static/bootstrap_datepicker_plus/"
app_static_url = "https://cdn.jsdelivr.net/gh/monim67/django-bootstrap-datepicker-plus@5.0.2/src/bootstrap_datepicker_plus/static/bootstrap_datepicker_plus/"
debug: bool = Field(default_factory=lambda: getattr(django_settings, "DEBUG", True))

@validator("addon_icon_classes")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
const widgetInstance = { config, $element: $inputWrapper, dateTimePickerData: $inputWrapper.data("DateTimePicker") }
widgetInstance.dateTimePickerData.date(moment(hiddenInputElement.value, config.backend_date_format));
widgetInstance.$element.on("dp.change", function (e) {
hiddenInputElement.value = e.date.format(config.backend_date_format);
hiddenInputElement.value = e.date ? e.date.format(config.backend_date_format) : null;
});
for (let [eventName, handler] of Object.entries(config.events)) {
widgetInstance.$element.on(eventName, handler);
Expand Down

0 comments on commit 08fcfc7

Please sign in to comment.