Skip to content

Commit

Permalink
Use parseToDateWithTimeAndMillis to make sure calculation is exact
Browse files Browse the repository at this point in the history
  • Loading branch information
martinweiler committed Nov 28, 2024
1 parent 469eb21 commit 4f151f8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ public void testCalculateMinutesBeforeStartHour() {
config.setProperty(BusinessCalendarImpl.HOURS_PER_DAY, "4");
config.setProperty(BusinessCalendarImpl.START_HOUR, "14");
config.setProperty(BusinessCalendarImpl.END_HOUR, "18");
String currentDate = "2024-11-28 10:48:33";
String currentDate = "2024-11-28 10:48:33.000";
String duration = "10m";
String expectedDate = "2024-11-28 14:10:00";

SessionPseudoClock clock = new StaticPseudoClock(parseToDateWithTime(currentDate).getTime());
SessionPseudoClock clock = new StaticPseudoClock(parseToDateWithTimeAndMillis(currentDate).getTime());
BusinessCalendarImpl businessCal = new BusinessCalendarImpl(config, clock);

Date result = businessCal.calculateBusinessTimeAsDate(duration);
Expand Down

0 comments on commit 4f151f8

Please sign in to comment.