List of usage examples for java.time YearMonth getMonthValue
public int getMonthValue()
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); int m = y.getMonthValue(); System.out.println(m);//from ww w .j a v a 2 s .c o m }
From source file:org.opensingular.form.wicket.mapper.YearMonthMapper.java
@Override public String getReadOnlyFormattedText(WicketBuildContext ctx, IModel<? extends SInstance> model) { if ((model != null) && (model.getObject() != null)) { SInstance instancia = model.getObject(); if (instancia.getValue() instanceof YearMonth) { YearMonth ym = (YearMonth) instancia.getValue(); return String.format("%02d/%04d", ym.getMonthValue(), ym.getYear()); }//from w w w . j a v a2s. c o m } return StringUtils.EMPTY; }