Package org.gwtwidgets.client.util

Examples of org.gwtwidgets.client.util.SimpleDateParser


  }

  private void testDateFormat1() {
    String format = "dd/MM/yyyy HH:mm:ss";
    GWT.log(format, null);
    SimpleDateParser parser = new SimpleDateParser(format);
    Date date = parser.parse("05/10/1977 12:45:31");
    _assert(date.getDate() == 5);
    _assert(date.getMonth() == 9);
    _assert(date.getYear()+1900 == 1977);
    _assert(date.getHours() == 12);
    _assert(date.getMinutes() == 45);
View Full Code Here


  }
 
  private void testDateFormat2() {
    String format = "dd'MM'yyyy";
    GWT.log(format, null);
    SimpleDateParser parser = new SimpleDateParser(format);
    Date date = parser.parse("05MM1977");
    _assert(date.getDate() == 5);
    _assert(date.getYear()+1900 == 1977);
  }
View Full Code Here

  private void testDateFormat3() {
    String sformat = "dd/MM/yyyy HH:mm:ss";
    GWT.log(sformat, null);
    SimpleDateFormat format = new SimpleDateFormat("EEEE dd-MM-yyyy HH:mm:ss");
    SimpleDateParser parser = new SimpleDateParser(sformat);
    Date date = parser.parse("05/10/1977 12:45:31");
    String text = format.format(date);
    _assert("Wednesday 05-10-1977 12:45:31".equals(text));
  }
View Full Code Here

 
  private void testDateFormat4() {
   
    String format = "yyyy/MM/dd";
    GWT.log(format, null);
    SimpleDateParser parser = new SimpleDateParser(format);
    Date date = parser.parse("2007/09/14");
    _assert(date.getDate() == 14);
    _assert(date.getMonth() == 8);
    _assert(date.getYear()+1900 == 2007);
  }
View Full Code Here

TOP

Related Classes of org.gwtwidgets.client.util.SimpleDateParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.