Skip to content

Commit

Permalink
Update SUTime to pick timezones based on the current year
Browse files Browse the repository at this point in the history
  • Loading branch information
AngledLuffa committed Oct 22, 2024
1 parent 5017920 commit c55691c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/edu/stanford/nlp/time/TimeFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.time.Year;
import java.util.*;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -628,8 +629,9 @@ public TimeZoneComponent(Locale locale)
}

private static void updateTimeZoneNames(Locale locale) {
long time1 = new SUTime.IsoDate(2013,1,1).getJodaTimeInstant().getMillis();
long time2 = new SUTime.IsoDate(2013,6,1).getJodaTimeInstant().getMillis();
int year = Year.now().getValue();
long time1 = new SUTime.IsoDate(year,1,1).getJodaTimeInstant().getMillis();
long time2 = new SUTime.IsoDate(year,6,1).getJodaTimeInstant().getMillis();
CollectionValuedMap<String,DateTimeZone> tzMap = new CollectionValuedMap<>();
for (DateTimeZone dtz:TimeZoneIdComponent.timeZonesById.values()) {
// standard timezones
Expand Down

0 comments on commit c55691c

Please sign in to comment.