Skip to content

[BUG] isDateOk() #3175

@GerardMensoif

Description

@GerardMensoif

Description

The isDateOk() function has two bugs:

  1. Line ~1041: $maxDateValue = $minDateValue->modify('+6 year')->format(...)

    • modify() modifies the object in place and returns it
    • So $maxDateValue becomes a DateTime object, not a string
    • This causes "Object of class DateTime could not be converted to string" error in the log line
  2. The hardcoded +6 year limit from 2020 means the check fails starting January 1st, 2026

Fix:

  • Line 1041: Use (clone $minDateValue)->modify('+6 year') to avoid modifying the original object
  • Increase to +10 years or make it dynamic
  • Line 1047: Add ->format('Y-m-d') to $minDateValue in the log message

Type de matériel / Hardware type

Autre / Other

Version de Jeedom / Jeedom Version

4.5.2

Navigateur / Browser

No response

Étapes pour reproduire / Steps to reproduce

0000|[2026-01-01 00:00:25] ERROR : Erreur sur jeedom::cron() : Object of class DateTime could not be converted to string

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions