Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] core/php/utils.inc.php : fonction date_fr - October #2967

Closed
Lacrymal3 opened this issue Nov 1, 2024 · 0 comments · Fixed by #2972
Closed

[BUG] core/php/utils.inc.php : fonction date_fr - October #2967

Lacrymal3 opened this issue Nov 1, 2024 · 0 comments · Fixed by #2972
Assignees
Labels

Comments

@Lacrymal3
Copy link

Décrire le bogue
La fonction date_fr ne converti pas le mois 'October' en français (et certainement dans les autres langues).

Reproduire
Etapes pour reproduire le comportement :

  1. Allez dans le plugin virtuel.
  2. Créer un commande info.
  3. Dans valeur, mettre une date correspondant au mois d'octobre et utiliser la fonction date_fr. Exemple de mon cas :
    str_replace(':', 'h',date_fr(date('l j F - G:i',strtotime(now))))
  4. Sauvegarder

Comportement attendu
Le résultat doit afficher une date en français (c'est bon pour le jour de semaine mais pas pour le mois d'octobre).

Jeedom :

  • Version : 4.4.18 et 4.4.19

Contexte supplémentaire
Extrait du code (il y a un espace en trop après October($|\W '/(^|\W)October($|\W )/') :
$texte_long_en = array( '/(^|\W)Monday($|\W)/', '/(^|\W)Tuesday($|\W)/', '/(^|\W)Wednesday($|\W)/', '/(^|\W)Thursday($|\W)/', '/(^|\W)Friday($|\W)/', '/(^|\W)Saturday($|\W)/', '/(^|\W)Sunday($|\W)/', '/(^|\W)January($|\W)/', '/(^|\W)February($|\W)/', '/(^|\W)March($|\W)/', '/(^|\W)April($|\W)/', '/(^|\W)May($|\W)/', '/(^|\W)June($|\W)/', '/(^|\W)July($|\W)/', '/(^|\W)August($|\W)/', '/(^|\W)September($|\W)/', '/(^|\W)October($|\W )/', '/(^|\W)November($|\W)/', '/(^|\W)December($|\W)/', );

La correction proposée :
$texte_long_en = array( '/(^|\W)Monday($|\W)/', '/(^|\W)Tuesday($|\W)/', '/(^|\W)Wednesday($|\W)/', '/(^|\W)Thursday($|\W)/', '/(^|\W)Friday($|\W)/', '/(^|\W)Saturday($|\W)/', '/(^|\W)Sunday($|\W)/', '/(^|\W)January($|\W)/', '/(^|\W)February($|\W)/', '/(^|\W)March($|\W)/', '/(^|\W)April($|\W)/', '/(^|\W)May($|\W)/', '/(^|\W)June($|\W)/', '/(^|\W)July($|\W)/', '/(^|\W)August($|\W)/', '/(^|\W)September($|\W)/', '/(^|\W)October($|\W)/', '/(^|\W)November($|\W)/', '/(^|\W)December($|\W)/', );

@Lacrymal3 Lacrymal3 added the bug label Nov 1, 2024
@Salvialf Salvialf mentioned this issue Nov 5, 2024
5 tasks
@Salvialf Salvialf linked a pull request Nov 5, 2024 that will close this issue
5 tasks
@Salvialf Salvialf self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants