use of com.xpn.xwiki.objects.DateProperty in project xwiki-platform by xwiki.
the class DateClass method newProperty.
@Override
public BaseProperty newProperty() {
BaseProperty property = new DateProperty();
property.setName(getName());
return property;
}
use of com.xpn.xwiki.objects.DateProperty in project xwiki-platform by xwiki.
the class DateClassTest method toFormString.
@Test
public void toFormString() throws Exception {
DateClass dateClass = new DateClass();
dateClass.setDateFormat("MMMM yyyy");
when(localizationContext.getCurrentLocale()).thenReturn(new Locale("ro"));
DateProperty property = new DateProperty();
property.setValue(new SimpleDateFormat("MM/yyyy").parse("10/2015"));
assertEquals("octombrie 2015", dateClass.toFormString(property));
}
Aggregations