List of usage examples for org.joda.time YearMonth toString
public String toString(String pattern, Locale locale) throws IllegalArgumentException
From source file:org.openmrs.module.mirebalaisreports.fragment.controller.field.MonthSinceMirebalaisOpeningFragmentController.java
License:Open Source License
public void controller(FragmentModel model) { List<SimpleObject> months = new ArrayList<SimpleObject>(); YearMonth earliest = new YearMonth(2013, 2); YearMonth month = new YearMonth().minusMonths(1); while (month.isAfter(earliest)) { months.add(SimpleObject.create("label", month.toString("MMM yyyy", Context.getLocale()), "value", month.toString("yyyy-MM-01"))); month = month.minusMonths(1);//ww w. j a v a 2 s. co m } model.addAttribute("months", months); }