DateFormatter: make TextToDate() long date calendar aware, tdf#125035
commit28859cd06cc699708bb43cb5e4ac7077d3a10f5b
authorEike Rathke <erack@redhat.com>
Mon, 5 Jul 2021 16:37:37 +0000 (5 18:37 +0200)
committerEike Rathke <erack@redhat.com>
Mon, 5 Jul 2021 20:04:33 +0000 (5 22:04 +0200)
tree413cbd97d7a90d7bbc4dbb46f6eab4ab91daa52a
parent6cb400f41df0dd108cdb4b4d3ec6656844814147
DateFormatter: make TextToDate() long date calendar aware, tdf#125035

Using number formatter to display long date now can generate any
arbitrary date string in any calendar known to the locale. Cope
with non-default non-Gregorian calendars when parsing such string
back to a date and convert to Gregorian for the calendar widget.

This currently relies on month names being different between
calendars, which isn't fail-proof but at least works for the ar_DZ
Hijri->Gregorian case.

A better approach would be to remember the calendar used in the
number formatter output, but that's not available (yet?).

Change-Id: I829655275de4d1983b7e453624efca967b16a3bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118449
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
vcl/source/control/field2.cxx