Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javascript fails to set the hidden value when the remove icon is clicked #86

Closed
daveisagit opened this issue Nov 25, 2022 · 2 comments
Closed

Comments

@daveisagit
Copy link

daveisagit commented Nov 25, 2022

Describe the bug
Script should allow for a null date value

To Reproduce
Steps to reproduce the behaviour:
You can reproduce this on your demo pages

  1. Enable a date input picker with the remove icon
  2. Use the remove icon and the hidden value is not nulled out, and so the form action uses the last value entered.

datepicker-widget.js:119 Uncaught TypeError: e.date.format is not a function
at HTMLDivElement. (datepicker-widget.js:119:41)
at HTMLDivElement.dispatch (jquery-3.5.1.min.js:2:43090)
at v.handle (jquery-3.5.1.min.js:2:41074)
at Object.trigger (jquery-3.5.1.min.js:2:71513)
at HTMLDivElement. (jquery-3.5.1.min.js:2:72108)
at Function.each (jquery-3.5.1.min.js:2:2976)
at S.fn.init.each (jquery-3.5.1.min.js:2:1454)
at S.fn.init.trigger (jquery-3.5.1.min.js:2:72084)
at h (bootstrap-datetimepicker.min.js:1:7860)
at g (bootstrap-datetimepicker.min.js:1:13676)

Expected behaviour
The field should be represented with a None value

on line 119 e.date will be null in this case
hiddenInputElement.value = e.date.format(config.backend_date_format);

@daveisagit
Copy link
Author

Thanks, quick turn around 👍

@monim67
Copy link
Owner

monim67 commented Nov 25, 2022

Thanks for your detailed PR, the issue was addressed swiftly. Fixed in 5.0.2.

@monim67 monim67 closed this as completed Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants