Bug 389866 - Date Input Field Not Localized
Summary: Date Input Field Not Localized
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: 2.10.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Stephane MANKOWSKI
URL:
Keywords:
: 390098 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-04 11:16 UTC by Bob Stouffer
Modified: 2018-02-09 07:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Stouffer 2018-02-04 11:16:45 UTC
My system uses the American English locality, so short dates are formatted m/d/Y. Skrooge displays this as expected in the Date column shown in Operations. However, when I choose a date in the Date input to create a transaction, the date is shown in dd/mm/yyyyy format.
Comment 1 Stephane MANKOWSKI 2018-02-04 12:45:50 UTC
Hi,

2 years ago, I did the following correction:
https://bugs.kde.org/show_bug.cgi?id=350722

To explain, to avoid wrong dates, skrooge use "dd/mm/yyyy" as date format for the date editor WHEN the system date format doesn't have the full year (eg. 2018) but only the short year (eg. 18).

In you case, your local is set with a short year, this is why skrooge uses the default "dd/mm/yyyy".

Is my answer acceptable? Do you see something that could be done on Skrooge to avoid this misunderstanding?

Regards.
Comment 2 Bob Stouffer 2018-02-04 13:32:24 UTC
I don't know much about formatting dates in Qt, but looking at the patch on the ticket you linked, it might be possible to call QLocale::dateTimeFormat(QLocale::ShortFormat) and if the returned QString does not contain 'yyyy', replace 'yy' with 'yyyy' and use that as your mAlternativeDateFormatToUse.
Comment 3 Stephane MANKOWSKI 2018-02-04 14:57:41 UTC
Git commit 438ee7bc51339b8482ad0d998b4dcd8c8f9fe73f by Stephane MANKOWSKI.
Committed on 04/02/2018 at 14:57.
Pushed by smankowski into branch 'master'.

Date Input Field Not Localized

M  +1    -0    CHANGELOG
M  +6    -5    skgbasegui/kdateedit.cpp
M  +5    -4    skgbasegui/kdatevalidator.cpp

https://commits.kde.org/skrooge/438ee7bc51339b8482ad0d998b4dcd8c8f9fe73f
Comment 4 Stephane MANKOWSKI 2018-02-04 14:57:59 UTC
Good idea. done!
Comment 5 Stephane MANKOWSKI 2018-02-09 07:24:47 UTC
*** Bug 390098 has been marked as a duplicate of this bug. ***