From c7c143e0380d38d74d1393f32187e250c7b4ceba Mon Sep 17 00:00:00 2001 From: bach Date: Sun, 6 Sep 2026 18:07:52 +0200 Subject: [PATCH] Revert: force jj/mm/aaaa on the ligne_comptable date field Back to the native widget, per request. Co-Authored-By: Claude Sonnet 5 --- .../figli_compta_ledger.module | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module b/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module index b5b7354..092e6f6 100644 --- a/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module +++ b/web/modules/custom/figli_compta_ledger/figli_compta_ledger.module @@ -37,22 +37,6 @@ function figli_compta_ledger_form_alter(&$form, FormStateInterface $form_state, } $form['#validate'][] = 'figli_compta_ledger_validate_repartition'; - // The default date widget renders as a native , - // whose displayed digit order (07/26/2024 vs 26/07/2024) follows the - // browser's own locale setting -- not anything Drupal or this site's - // language controls, so an English-locale browser shows the American - // mm/dd/yyyy order no matter what. Switching the date sub-element from - // 'date' (native picker) to 'text' with an explicit PHP date format - // makes Drupal itself own the display/parsing, so it's the same - // jj/mm/aaaa for everyone regardless of browser locale. Trade-off: - // loses the native calendar picker (Drupal core ships no JS date- - // picker to pair with the text variant) -- acceptable here, dates are - // typically typed directly for this kind of data entry. - if (isset($form['field_date_ligne']['widget'][0]['value'])) { - $form['field_date_ligne']['widget'][0]['value']['#date_date_element'] = 'text'; - $form['field_date_ligne']['widget'][0]['value']['#date_date_format'] = 'd/m/Y'; - } - // Every save must create a revision, unconditionally -- there's no // legitimate reason to skip it for an accounting record, so don't let // anyone opt out. #access = FALSE (rather than just leaving the