#6958 (Support french date formatting)

by Luc Saffre · in Developers · assigned to Luc Saffre

Kurzbeschreibung

When I enter "13/6/1968" in a birth_date and hit Ctrl+S, Lino says "invalid literal for int() with base 10: '13/8/1668' ".

When I enter "13/6/1968" as the start_date of a calendar entry, Lino gets confused and weird things happen.

French-speaking people want to see dates as dd/mm/yyyy while German/Dutch-speaking people want dd.mm.yyyy.

The "internal" format used by the API doesn't need to be configurable, it should be yyyy-mm-dd.

Kinder

Kommentare

  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : I can now enter values like "1 june 1968" or "juin 1968" into the birth_date field and Lino understands me.
  • 2 Monate, 1 Woche ago von Luc Saffre Antwort auf Luc Saffre about #6958 (Support french date formatting) : IncompleteDate values were still rendered using SITE.date_format_strftime. This is done in lino.utils.py2js(). Now they are always rendered using YYYY-MM-DD.
  • 2 Monate, 1 Woche ago von Luc Saffre Antwort auf Luc Saffre about #6958 (Support french date formatting) : That was because IncompleteDateStoreField.parse_form_value() was using SITE.parse_date. Now it uses IncompleteDate.parse(), which uses dateparser.
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) (2 Antworten) : For birth_date it doesn't yet work. This is an IncompleteDateField.
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : Sounds good. Will test it ASAP on the stewards site.
  • 2 Monate, 1 Woche ago von Sharif Mehedi about #6958 (Support french date formatting) : I kept the core implementation for parsing and formatting date as it is, didn't touch anything on the core and in react I have a new plugin option date_format and it makes the UI display date as given on it, but the ajax works with the older `dd.mm.yy` format implementation. So, this plugin option `...
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : Next step: use the moment package in react and have the date format configurable as a plugin setting. No need to have it also language-specific right now.
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : This ticket will now wait until Quill is in a state where @8lurry can make a break. Because it will also need changes in the react front end.
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : I pushed another series of code refactoring changes and released them to PyPI, including rstgen, atelier and lino.
  • 2 Monate, 1 Woche ago von Luc Saffre Antwort auf Luc Saffre about #6958 (Support french date formatting) : We already have LanguageInfo, which currently is just a namedtuple, but we can rewrite it as a class.
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) (1 Antwort) : It's not only about date formatting but also about number formatting. See DecimalFieldElement. Number formatting is less urgent because FR and DE are the same, but it makes sense to care for it as well. We will probably want to move these settings from the Site class to a "LinoLocale" object, which ...
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : Officially, the only date format supported by JavaScript is a simplified version of ISO-8601: yyyy-mm-dd, although in practice almost all browsers also support yyyy/mm/dd as well. But other than that, you have to write the code yourself or (and this makes much more sense) use a good library. I'd pro...
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : This innocent request for #6802 (The Stewards project (Lino Patrols)) might cause an internal revolution: the Site.parse_date() method. And User.date_format will maybe go away, the date format rather depends on the language of the front end,
  • 2 Monate, 1 Woche ago von Luc Saffre about #6958 (Support french date formatting) : Created new Ticket #6958 (The format of a IncompleteDate field (birth_date)).