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

Localized date-inputs and daterange-picker #540

Merged
merged 7 commits into from Feb 3, 2019
Merged

Conversation

@kevinpapst
Copy link
Owner

kevinpapst commented Feb 3, 2019

Improvements in this PR

  • localized date input fields
  • added daterange picker for toolbars

Localized date input fields

Date and DateTime fields now support language specific formats:
bildschirmfoto 2019-02-03 um 14 11 22
bildschirmfoto 2019-02-03 um 14 11 12

Added daterange picker for toolbars

The begin and end input fields in toolbars were replaced by a date range picker, which allows for quicker select of ranges, including some pre-defined values like "today, yesterday, last week, this year..."

bildschirmfoto 2019-02-03 um 01 55 28

bildschirmfoto 2019-02-03 um 14 11 03

ping @infeeeee can you support me with a test on this one? You mentioned it in #534 and I wanted to improve it for a while now, so I gave it a try.

@kevinpapst kevinpapst added this to the 0.8 - Export, Timezones, UI milestone Feb 3, 2019
date_time: 'yyyy.MM.dd HH:mm'
date_time_picker: 'YYYY.MM.DD HH:mm'
date: 'yyyy.MM.dd'
date_picker: 'YYYY.MM.DD'

This comment has been minimized.

Copy link
@infeeeee

infeeeee Feb 3, 2019

Contributor
Suggested change
date_picker: 'YYYY.MM.DD'
ddate_time: 'yyyy.MM.dd. HH:mm'
date_time_picker: 'YYYY.MM.DD. HH:mm'
date: 'yyyy.MM.dd.'
date_picker: 'YYYY.MM.DD.'

In Hungarian we always put a dot after the number of the day.
If you don't fix it now, I will fix it when I update the translation with the new words.

This comment has been minimized.

Copy link
@kevinpapst

kevinpapst Feb 3, 2019

Author Owner

There is a typo in ddate_time so I can't commit it directly here.

@infeeeee

This comment has been minimized.

Copy link
Contributor

infeeeee commented Feb 3, 2019

Wow! really nice! I wanted to create a feature request for this, but you were quicker! It's very user friendly, thank you! I don't see any bugs.

Minor problem: I see that the start of the week depends on the selected language. If I change to english it's from sunday to saturday, in hungarian it's from monday to sunday. Is it possible to change this independently from the language? It can create confusion in a multi language environment, where the users use different languages. Maybe an option in the settings "start of week" or in a .env or similar file where I can select from "use locale" and "force monday/sunday". If it's not fixed it's ok, it's not a common feature, e.g. it's not implemented in nextcloud neither. If it's implemented it should affect the calendar view as well.

@kevinpapst

This comment has been minimized.

Copy link
Owner Author

kevinpapst commented Feb 3, 2019

Thanks for the test and format feedback @infeeeee

Yes, there is a setting for the first day of the week in the JS date-picker. I am not sure about the calendar, but every calendar component should support this.
Currently it is hardcoded to be 1 (Monday) in the datepicker. And the calendar seems to be bound to the language. I never use the calendar, so I don't recognize these things ^^

Having this setting in a config sounds as wrong as binding it to the users language. Kimai supports full locales as well, but unless we don't really need them, I'd like to avoid the configuration overhead.
As I'd really like to stick to KISS and avoid as many user settings as possible we stick with your approach - put it in a config file for now => can you please open a new issues for that?

@kevinpapst kevinpapst merged commit 062735c into master Feb 3, 2019
2 checks passed
2 checks passed
Scrutinizer 4 new issues, 56 updated code elements
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kevinpapst kevinpapst deleted the date-range-picker branch Feb 3, 2019
@lock

This comment has been minimized.

Copy link

lock bot commented Apr 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@lock lock bot locked and limited conversation to collaborators Apr 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.