Skip to content

Commit

Permalink
Added action for 'isBankHoliday(<file>)' (openhab#1703)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <[email protected]>
  • Loading branch information
cweitkamp authored Oct 7, 2020
1 parent 1edf25b commit c4b76a0
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,32 @@ public static boolean isInDayset(String daysetName, ZonedDateTime day) {
return EphemerisActionService.ephemerisManager.isInDayset(daysetName, day);
}

@ActionDoc(text = "checks if today is bank holiday")
@ActionDoc(text = "checks if today is a bank holiday")
public static boolean isBankHoliday() {
return isBankHoliday(0);
}

@ActionDoc(text = "checks if today plus or minus a given offset is bank holiday")
@ActionDoc(text = "checks if today plus or minus a given offset is a bank holiday")
public static boolean isBankHoliday(int offset) {
return isBankHoliday(ZonedDateTime.now().plusDays(offset));
}

@ActionDoc(text = "checks a given day is bank holiday")
@ActionDoc(text = "checks a given day is a bank holiday")
public static boolean isBankHoliday(ZonedDateTime day) {
return EphemerisActionService.ephemerisManager.isBankHoliday(day);
}

@ActionDoc(text = "checks if today plus or minus a given offset is bank holiday from a given userfile")
@ActionDoc(text = "checks if today is a bank holiday from a given userfile")
public static boolean isBankHoliday(String filename) {
return isBankHoliday(0, filename);
}

@ActionDoc(text = "checks if today plus or minus a given offset is a bank holiday from a given userfile")
public static boolean isBankHoliday(int offset, String filename) {
return isBankHoliday(ZonedDateTime.now().plusDays(offset), filename);
}

@ActionDoc(text = "checks a given day is bank holiday from a given userfile")
@ActionDoc(text = "checks a given day is a bank holiday from a given userfile")
public static boolean isBankHoliday(ZonedDateTime day, String filename) {
try {
return EphemerisActionService.ephemerisManager.isBankHoliday(day, filename);
Expand Down

0 comments on commit c4b76a0

Please sign in to comment.