OllisGit/OctoPrint-SpoolManager

unable to set a bought on: date

Closed this issue · 19 comments

when creating a new spool or editing an existing one, if a bought on: date is specified, the changes won't stick or the new spool won't get registered at all. this seems to happen whether the date is in the past or the future.

Hi @themoonisacheese,

do the following:

  • use chrome browser and open the development tools
  • switch to "network tab"
  • open the spool dialog and enter your data
  • press save and look into the network tab for read line

screenshot the browser and attach it here

here is the screenshot.
the response just is standard text for a 500 http error.
image
this is the only field that behaves like this from what i can tell, i've been able to populate all other fields without issue.
this is still the case after updating to the latest version today.

Hi @themoonisacheese,
looks like the issue is located on the server side and not in the browser.
Please attach the OP-Log file as well.
image

log:
octoprint(1).log

i've re-tried saving my changes to the spool just before generating the log.

since the above log is only 64k and seems to cut off like 3 hours ago, i suspected octoeverywhere to at least be interfering with the logs, but it seems it is also interfering with this field. when i look at octoprint from my local network, the field is already populated with "1.11.2021" which is not a date I ever submitted, and submitting a new one is still not working. here's the proper log:
octoprint(2).log

Well it is a javascript issue. The Datepicker use a wrong format. Maybe a local settings in the browser. What language do you use in the browser?

ValueError: time data '1.41.2021' does not match format '%d.%m.%Y'

Hi @themoonisacheese,

I tried to reproduce the issue with different browsers and browser locals, but without success. Everytime the purchase date was in the correct format.

Please attach a screenshot of the edit dialog after you selected the date and after that also network log-shot from the browser.

I've had similar problems with the current firefox (93.0). When I select a date for the purchased, for example, say 10/25/2021, it actually fills in 1.36.2021, then throws the datetime format error in the log when trying to save.

Can confirm problems. The first and last used dropdown list also produce a broken time setting. The moment you click on a date it inserts the bugged date into the field. If you type in a date by hand it also parses it to the incorrect date.

grafik
grafik
grafik

Hi @oerkel47,
thanks for providing the screenshots. You and @themoonisacheese and @lorez42 are using Firefox. Is this issue also reproducible with a chrome browser.
I played around with FireFox, different browser locals, but I was not able to reproduce the error.

It looks like that the datetimepicker is also not supported any more and I couldn't find an related issue in tracker.
https://github.com/xdan/datetimepicker

Thanks for looking into it.

Same problem in chrome and on my phones firefox.

hmmm...okay, I think I will switch to the html-standard picker: https://www.w3schools.com/tags/att_input_type_datetime-local.asp
....but the user needs a "modern" browser.

chrome has had support for this for 9 years, but firefox only recently added datetime-local in version 93 this year. maybe the more recent versions that support the standard don't work well with the previous datetime picker?

hmmm...okay, I think I will switch to the html-standard picker: https://www.w3schools.com/tags/att_input_type_datetime-local.asp ....but the user needs a "modern" browser.

As long as the unsupported browsers can still use the manual input that wouldn't be too critical imo.

Can confirm that this happens both in Chrome and Firefox for me. Not sure what is the cause as I should have English locale set.

Hi,
in the latest release I change the date/time-picker to the browser-native implementation. I think this is the best solution...hopefully ;-)

Please test and give a feedback.

Thx in advance,
Olli

The datepicker seems to be working just fine now - thank you.

In the latest version it works great. Thanks a lot!