Use the pattern "MM/yyyy" or "MM/yy", and the user will change it if needed.


On Fri, May 2, 2014 at 12:31 PM, Otávio Garcia <notifications@github.com>wrote:

> In
> vraptor-javatime/src/test/java/br/com/caelum/vraptor/converter/YearMonthConverterTest.java:
>
> > +
> > +/**
> > + * Tests to {@link YearMonthConverter}.
> > + */
> > +public class YearMonthConverterTest {
> > +
> > +	private YearMonthConverter converter;
> > +
> > +	@Before
> > +	public void setup() {
> > +		converter = new YearMonthConverter(new Locale("pt", "BR"));
> > +	}
> > +
> > +	@Test
> > +	public void shouldBeAbleToConvert() {
> > +		assertThat(converter.convert("01/06/2007", YearMonth.class), is(equalTo(YearMonth.of(2007, 6))));
>
> Using new DateTimeFormatterBuilder().toFormatter(locale) throws Text
> '05/2014' could not be parsed, unparsed text found at index 0.
>
> Using getLocalizedDateTimePattern to get the pattern always returns
> something like dd/MM/yyyy.
>
> Any another idea?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/caelum/vraptor-time-converters/pull/4/files#r12233756>
> .
>