Ejemplo n.º 1
0
  @Test
  public void testGetLastMonthofMonth() throws ParseException {
    Date lastDay = DateUtils.getLastMonthofMonth(sdf.parse("2011-10-05"));
    Assert.assertEquals("2011-10-31", sdf.format(lastDay));

    lastDay = DateUtils.getLastMonthofMonth(sdf.parse("2011-11-05"));
    Assert.assertEquals("2011-11-30", sdf.format(lastDay));
  }
Ejemplo n.º 2
0
 @Test
 public void testGetFirstDayofMonth() throws ParseException {
   Date firstDay = DateUtils.getFirstDayofMonth(sdf.parse("2011-10-05"));
   Assert.assertEquals("2011-10-01", sdf.format(firstDay));
 }