src/main/java/de/blau/android/validation/BaseValidator.java
/**
     * Check that the date value of tag is not more that validFor seconds old
     * 
     * @param tags tags for the element
     * @param now current time in milliseconds
     * @param tag tag to retrieve the date value for
     * @param validFor time the element is valid for in seconds
     * @return Validator.AGE is too old, otherwise Validator.NOT_VALIDATED
     */
Check that the date value of tag is not more that validFor seconds old


Check that the date value of tag is not more that validFor seconds old
private int checkAge(@NonNull SortedMap<String, String> tags, long now, @NonNull String tag, long validFor) {
        try {
            return now - new SimpleDateFormat(Tags.CHECK_DATE_FORMAT, Locale.US).parse(tags.get(tag)).getTime() / 1000 > validFor ? Validator.AGE
                    : Validator.NOT_VALIDATED;
        } catch (ParseException e) {
            return Validator.AGE;
        }
    }
private int checkAge ( @ NonNull SortedMap < String , String > tags , long now , @ NonNull String tag , long validFor ) { try { return now - new SimpleDateFormat ( Tags . CHECK_DATE_FORMAT , Locale . US ) . parse ( tags . get ( tag ) ) . getTime ( ) / 1000 > validFor ? Validator . AGE : Validator . NOT_VALIDATED ; } catch ( ParseException e ) { return Validator . AGE ; } }
Check that the date value of tag is not more that validFor seconds old
Check that the date value of tag is not more that validFor seconds old