code: public String correctDurationValue(String value) {
  		if (value.matches("PT[0-9]+H")){
  			for (MatchResult mr : Toolbox.findMatches(Pattern.compile("PT([0-9]+)H"), value)){
  				try {
  					int hours = Integer.parseInt(mr.group(1));
  					if ((hours % 24) == 0){
  						int days = hours / 24;
  						value = "P"+days+"D";
  					}
  				} catch(NumberFormatException e) {
  					Logger.printDetail(component, "Couldn't do granularity conversion for " + value);
  				}
  			}
  		} else if (value.matches("PT[0-9]+M")){
  			for (MatchResult mr : Toolbox.findMatches(Pattern.compile("PT([0-9]+)M"), value)){
  				try {
  					int minutes = Integer.parseInt(mr.group(1));
  					if ((minutes % 60) == 0){
  						int hours = minutes / 60;
  						value = "PT"+hours+"H";
  					}
  				} catch(NumberFormatException e) {
  					Logger.printDetail(component, "Couldn't do granularity conversion for " + value);
  				}
  			}
  		} else if (value.matches("P[0-9]+M")){
  			for (MatchResult mr : Toolbox.findMatches(Pattern.compile("P([0-9]+)M"), value)){
  				try {
  					int months = Integer.parseInt(mr.group(1));
  					if ((months % 12) == 0){
  						int years = months / 12;
  						value = "P"+years+"Y";
  					}
  				} catch(NumberFormatException e) {
  					Logger.printDetail(component, "Couldn't do granularity conversion for " + value);
  				}
  			}
  		}
  		return value;
  	}
docs: Durations of a finer granularity are mapped to a coarser one if possible, e.g., "PT24H" -> "P1D".
  One may add several further corrections.
  @param value
  @return