verify that parsing works for dates with slash

This commit is contained in:
kimchy 2010-05-03 16:51:15 +03:00
parent 5d743383c7
commit 3ba4370477
2 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,8 @@
package org.elasticsearch.deps.joda;
import org.elasticsearch.util.joda.FormatDateTimeFormatter;
import org.elasticsearch.util.joda.Joda;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
@ -63,4 +65,9 @@ public class SimpleJodaTests {
Date date = new Date();
assertThat(formatter.parseMillis(dateTimeWriter.print(date.getTime())), equalTo(date.getTime()));
}
@Test public void testSlashInFormat() {
FormatDateTimeFormatter formatter = Joda.forPattern("MM/yyyy");
formatter.parser().parseMillis("01/2001");
}
}

View File

@ -41,6 +41,7 @@ dependencies {
compile("org.jclouds:jclouds-httpnio:$jcloudsVersion")
compile("org.jclouds:jclouds-blobstore:$jcloudsVersion")
compile("org.jclouds:jclouds-aws:$jcloudsVersion")
distLib("org.jclouds:jclouds-httpnio:$jcloudsVersion")
distLib("org.jclouds:jclouds-blobstore:$jcloudsVersion")
distLib("org.jclouds:jclouds-aws:$jcloudsVersion")