Bug 457479

Summary: DigiKam does not help the user to enter dates quickly
Product: [Applications] digikam Reporter: Peter <benedekppeter>
Component: Metadata-DateAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 7.7.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 7.8.0
Sentry Crash Report:

Description Peter 2022-08-04 11:52:17 UTC
DigiKam does not accept the date format of images only in this format (separated by spaces): ####. ##. ##. (example: 2022. 08. 04.)
If the user needs to change many dates, in this case much more faster, if the user writes this (without spaces): ####.##.##. or ####.#.#. or ####.##.## (without dot) (example: 2022.08.04. or 2022.8.4. or 2022.08.04)
If the user writes this: ####.##.##. or ####.#.#. , the digiKam does not change the date to the new date, but restores the old (original and and possibly faulty) date.

STEPS TO REPRODUCE
1. Choose an image
2. Captions -- Description -- Date:
3. Try change the date: 2022.08.04.
4. Apply

OBSERVED RESULT
DigiKam does not change the date to the new date, but restores the old (original) date.

EXPECTED RESULT
DigiKam formats and sets the date.
Example:
User write: 2022.08.04. ---> DigiKam formats date ---> 2022. 08. 04.

SOFTWARE/OS VERSIONS
Windows 10
Linux Mint 20.x -- Cinnamon; Appimage
Comment 1 Maik Qualmann 2022-08-04 13:49:36 UTC
What locale are they using? Here with German locale I don't have to enter any spaces. The date input depends on your locale, my input is also dd.mm.yyyy.

Maik
Comment 2 Peter 2022-08-04 14:41:06 UTC
(In reply to Maik Qualmann from comment #1)
> What locale are they using? Here with German locale I don't have to enter
> any spaces. The date input depends on your locale, my input is also
> dd.mm.yyyy.
> 
> Maik

Default: HU (but now I tryed EN and need the space)
Comment 3 Peter 2022-08-04 14:45:46 UTC
(In reply to Peter from comment #2)
> (In reply to Maik Qualmann from comment #1)
> > What locale are they using? Here with German locale I don't have to enter
> > any spaces. The date input depends on your locale, my input is also
> > dd.mm.yyyy.
> > 
> > Maik
> 
> Default: HU (but now I tryed EN and need the space)

Here is a short video about the problem: https://mega.nz/folder/kFwQ3bjQ#WwX3g0u6OlKwOD9Zef_fEA
Comment 4 Maik Qualmann 2022-08-04 18:42:09 UTC
Well if I set my system to Hungarian I can reproduce it. Changing the language in digiKam does not affect the date or number format. At the request of users and bug reports, the date format should be retained by the system, only the language should change in digiKam. I actually didn't think that was correct.
The question now is, is the date format in Hungarian so common with spaces and a period at the end, or did Qt make a mistake here? I could only find out in web that yyyy.mm.dd is used in Hungary.

Maik
Comment 5 Peter 2022-08-04 20:29:32 UTC
(In reply to Maik Qualmann from comment #4)
> Well if I set my system to Hungarian I can reproduce it. Changing the
> language in digiKam does not affect the date or number format. At the
> request of users and bug reports, the date format should be retained by the
> system, only the language should change in digiKam. I actually didn't think
> that was correct.
> The question now is, is the date format in Hungarian so common with spaces
> and a period at the end, or did Qt make a mistake here? I could only find
> out in web that yyyy.mm.dd is used in Hungary.
> 
> Maik

Unfortunately this format grammatically is correct (with spaces): yyyy. mm. dd.
But entering the date in this format is slow and may result in errors (digiKam does not change the date to the new date, but restores the old -- original and and possibly faulty -- date).
I saw several users how enter a date on the date field, and they always wrote it that way: yyyy.mm.dd. (without spaces). DigiKam didn't accept it and they didn't know what happened. I think in this case it is not a mistake if DigiKam does not adhere to the spelling rules. The date is also valid and usable in this case, and and data entry will be faster... ...or digikam needs to format the date after data entry.
What do you think?
Comment 6 Maik Qualmann 2022-08-04 20:33:27 UTC
Oracle also changed the Hungarian date format to with spaces:

https://community.oracle.com/tech/developers/discussion/4074048/hungarian-date-format-changed

Maik
Comment 7 Maik Qualmann 2022-08-04 20:46:58 UTC
We can remove the spaces, but if the user then types it correctly with spaces, it would probably result in an error. We cannot support both formats in one QDateTimeEdit.

Alternatively, you could set an environment variable in an appropriate language to get the desired date input format before starting digiKam.

Maik
Comment 8 Peter 2022-08-04 20:51:05 UTC
(In reply to Maik Qualmann from comment #6)
> Oracle also changed the Hungarian date format to with spaces:
> 
> https://community.oracle.com/tech/developers/discussion/4074048/hungarian-
> date-format-changed
> 
> Maik

Maybe because it is grammatically correct...
But this format makes bulk data entry extremely slow, and increases the number of errors (user add wrong date to the images, because the because the date is reset to the original value).
Comment 9 Peter 2022-08-04 21:07:15 UTC
> Alternatively, you could set an environment variable in an appropriate
> language to get the desired date input format before starting digiKam.
> 
> Maik

I changed the system regional settings: Short date: yyyy.mm.dd.
In this case the digiKam is works well. Thanks for the idea!