Allow configuration of 12/24 hour day
Some people prefer one format over another, so it would be good to allow them to choose it.
Remember to remove the field "AM/PM" when in the 24h format
Today the time inputs are using HTML input tag, which is a newer thing in HTML and follows the OS time configuration. In order to allow the user to select am/pm we must change to use some external API for Time picking.
This and #12 might be solved with https://www.npmjs.com/package/timepicker. At least that's one idea.
I've begun working on this using jquery-timepicker
https://github.com/kashaiahyah85/time-to-leave/tree/jquery-timpicker
YAY
@thamara can I work on this?
Sure!
Hey @samin-batra, any update on this?
Hi @thamara , I am working on this. I am trying to use the jquery-timepicker to achieve this. However, I ran into some issues. JQuery-timepicker is not working as expected (could be some set-up and initialization issues). I am working on resolving those.
I tried to achieve the same with the normal HTML time input but that doesn't work because it depends on the person's OS settings. Also, can we include some button at the top of the table which indicates 12/24h format? Or do we simply accept any kind of input?
Thanks for the update!
I ran into some issues. JQuery-timepicker is not working as expected (could be some set-up and initialization issues). I am working on resolving those.
Feel free to join the discord channel if you want to discuss something. You can also open a Draft PR so we can take a look together.
Also, can we include some button at the top of the table which indicates 12/24h format?
I prefer to have this kind of setting on the preferences window as this is something that the users will most likely set just one time. If it's on the calendar it will be kind of polluting the GUI.
I prefer to have this kind of setting on the preferences window as this is something that the users will most likely set just one time. If it's on the calendar it will be kind of polluting the GUI.
Makes sense. I'm checking and will get back.
Hi @samin-batra, any updates on this?
Hi Thamara. I was able to get the timepicker working but now the other validations don't seem to be working. I am trying to understand what the flow is related to validations. I haven't been able to work on this recently.
Thank for the update. When you have the time to work on this, let us know if we can help with anything.
After different tries, we keep hitting the issue of HTML's input time being tied to the OS. In order to support this we need to migrate to another solution, maybe something like moment.js library.
Hello. Is this issue still active? If yes I'd like to try to solve it. I'd appreciate a short reply before I start contributing. Thank you (:
Hey @Madiena, feel free to tackle it :) Let me assign it to you.
Hey @Madiena, just a heads-up, in the past, other people have tried to tackle this issue, and what we found out is that there's no way of doing such thing in vanilla html/javascript. To do so, we need an external library, something like https://www.npmjs.com/package/timepicker. Feel free to take a look, and suggest what you believe should be done. :)
Just to be clear: the only page that's affected by this issue would be the preferences page. Am I right?
The main window too, but it depends on your region configuration to show or not the AM/PM
No external Library required for this to work.
When selecting the language in the settings, you also have to change the language of electron.
For testing, this can be done by appending --lang=de to the time-to-leave executable.
time-to-leave.exe --lang=de
This should also be changeable in the code and has to be set during the startup:
app.commandLine.appendSwitch('lang', 'en')
So when changing the language, a restart is required to change the date-time format when the appendSwitch method is used during startup.
I would love to see this implemented because AM/PM time formats give me headaches 😉
Sources: https://www.electronjs.org/docs/latest/api/command-line-switches#--lang