support 'w' as suffix for time format

This commit is contained in:
kimchy 2011-03-01 20:16:18 +02:00
parent 0183516221
commit 0e30ad90f5
1 changed files with 2 additions and 0 deletions

View File

@ -235,6 +235,8 @@ public class TimeValue implements Serializable, Streamable {
millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 60 * 60 * 1000); millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 60 * 60 * 1000);
} else if (sValue.endsWith("d")) { } else if (sValue.endsWith("d")) {
millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 24 * 60 * 60 * 1000); millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 24 * 60 * 60 * 1000);
} else if (sValue.endsWith("w")) {
millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 7 * 24 * 60 * 60 * 1000);
} else { } else {
millis = Long.parseLong(sValue); millis = Long.parseLong(sValue);
} }