OllisGit / OctoPrint-SpoolManager

Plugin for managing Spools
168 stars 59 forks source link

unable to set a bought on: date #205

Closed themoonisacheese closed 2 years ago

themoonisacheese commented 3 years ago

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.

OllisGit commented 3 years ago

Hi @themoonisacheese,

do the following:

screenshot the browser and attach it here

themoonisacheese commented 3 years ago

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.

OllisGit commented 3 years ago

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

themoonisacheese commented 3 years ago

log: octoprint(1).log

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

themoonisacheese commented 3 years ago

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

OllisGit commented 3 years ago

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'
themoonisacheese commented 3 years ago

I use Firefox in France french, but octoprint is in English default.

OllisGit commented 3 years ago

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.

lorez42 commented 3 years ago

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.

oerkel47 commented 3 years ago

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

OllisGit commented 3 years ago

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

oerkel47 commented 3 years ago

Thanks for looking into it.

Same problem in chrome and on my phones firefox.

OllisGit commented 3 years ago

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.

themoonisacheese commented 2 years ago

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?

oerkel47 commented 2 years ago

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.

tszolar commented 2 years ago

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.

OllisGit commented 2 years ago

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

oerkel47 commented 2 years ago

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

tszolar commented 2 years ago

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