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

Cron builder uses wrong day #1371

Closed
questionmark78 opened this issue Jan 3, 2021 · 3 comments · Fixed by #2630
Closed

Cron builder uses wrong day #1371

questionmark78 opened this issue Jan 3, 2021 · 3 comments · Fixed by #2630
Labels
bug Something isn't working main ui Main UI

Comments

@questionmark78
Copy link

I used the cron builder in the Rules on OH3 to have a trigger on the first Monday of the month.
Screenshot 2021-01-03 at 12 12 53

But it triggered on a Sunday.

@Hilbrand
Copy link
Member

Hilbrand commented Feb 1, 2021

This seems to me a UI bug. 1 is Sunday. For example see https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm

@DarkPatch
Copy link

Tested using both WED and 4 and both activated on the correct day.

The UI is displaying the wrong text for the day of the week, one day in advance.

configuration: {}
triggers:
  - id: "1"
    configuration:
      cronExpression: 0 40 23 ? * 4 *
    type: timer.GenericCronTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: ZWaveNode02239354ZW4009SmartToggleSwitchHallwayCloset_Switch
      command: ON
    type: core.ItemCommandAction

image

  1. Sunday
  2. Monday
  3. Tuesday
  4. Wednesday
  5. Thursday
  6. Friday
  7. Saturday

My timezone is set for PST (GMT-8)
I tried changing my timezone to GMT but saw no change.

@Hilbrand
Copy link
Member

See also: #902

@kaikreuzer kaikreuzer transferred this issue from openhab/openhab-core Apr 26, 2022
@florian-h05 florian-h05 added bug Something isn't working main ui Main UI labels Mar 8, 2023
florian-h05 added a commit to florian-h05/openhab-webui that referenced this issue Jun 27, 2024
…onth

Fixes openhab#1371.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit that referenced this issue Jun 27, 2024
Fixes #1371.
Fixes #902.

This sets the UI's cron builder to use day 1 for Sunday, instead of
Monday, which is the convention as used by the Quartz scheduler, see
https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm
and https://freeformatter.com/cron-expression-generator-quartz.html.

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants