Ignore:
Timestamp:
2021-07-10T23:26:59+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21021 - proper fix of "newer" keyword, handling both formats (date and duration)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r17982 r17988  
    4646import org.openstreetmap.josm.tools.UncheckedParseException;
    4747import org.openstreetmap.josm.tools.Utils;
     48import org.openstreetmap.josm.tools.date.DateUtils;
    4849
    4950/**
     
    243244    }
    244245
    245     static String date(String humanDuration, LocalDateTime from) {
     246    static String date(String dateOrHumanDuration, LocalDateTime from) {
     247        try {
     248            return DateUtils.parseInstant(dateOrHumanDuration).toString();
     249        } catch (UncheckedParseException e) {
     250            Logging.trace(e);
     251        }
     252        return duration(dateOrHumanDuration, from);
     253    }
     254
     255    static String duration(String humanDuration, LocalDateTime from) {
    246256        // Convert to ISO 8601. Replace months by X temporarily to avoid conflict with minutes
    247257        String duration = humanDuration.toLowerCase(Locale.ENGLISH).replace(" ", "")
Note: See TracChangeset for help on using the changeset viewer.