Date locale support for the SimpleDateParser : Date Utilities « GWT « Java

Home
Java
1.2D Graphics GUI
2.3D
3.Advanced Graphics
4.Ant
5.Apache Common
6.Chart
7.Class
8.Collections Data Structure
9.Data Type
10.Database SQL JDBC
11.Design Pattern
12.Development Class
13.EJB3
14.Email
15.Event
16.File Input Output
17.Game
18.Generics
19.GWT
20.Hibernate
21.I18N
22.J2EE
23.J2ME
24.JDK 6
25.JNDI LDAP
26.JPA
27.JSP
28.JSTL
29.Language Basics
30.Network Protocol
31.PDF RTF
32.Reflection
33.Regular Expressions
34.Scripting
35.Security
36.Servlets
37.Spring
38.Swing Components
39.Swing JFC
40.SWT JFace Eclipse
41.Threads
42.Tiny Application
43.Velocity
44.Web Services SOA
45.XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Java » GWT » Date UtilitiesScreenshots 
Date locale support for the SimpleDateParser


package org.gwtwidgets.client.util;

import java.util.Arrays;
import java.util.List;

/**
 * Date locale support for the {@link SimpleDateParser}. You are encouraged to
 * extend this class and provide implementations for other locales. 
 @author <a href="mailto:g.georgovassilis@gmail.com">George Georgovassilis</a>
 *
 */
public class DateLocale {
  public final static String TOKEN_DAY_OF_WEEK = "E";

  public final static String TOKEN_DAY_OF_MONTH = "d";

  public final static String TOKEN_MONTH = "M";

  public final static String TOKEN_YEAR = "y";

  public final static String TOKEN_HOUR_12 = "h";

  public final static String TOKEN_HOUR_24 = "H";

  public final static String TOKEN_MINUTE = "m";

  public final static String TOKEN_SECOND = "s";
  
  public final static String TOKEN_MILLISECOND = "S";
  
  public final static String TOKEN_AM_PM = "a";

  public final static String AM = "AM";

  public final static String PM = "PM";

  public final static List SUPPORTED_DF_TOKENS = Arrays.asList(new String[] {
          TOKEN_DAY_OF_WEEK, TOKEN_DAY_OF_MONTH, TOKEN_MONTH, TOKEN_YEAR,
          TOKEN_HOUR_12, TOKEN_HOUR_24, TOKEN_MINUTE, TOKEN_SECOND,
          TOKEN_AM_PM });

  public String[] MONTH_LONG = "January""February""March""April",
          "May""June""July""August""September""October",
          "November""December" };

  public String[] MONTH_SHORT = "Jan""Feb""Mar""Apr""May""Jun",
          "Jul""Aug""Sept""Oct""Nov""Dec" };

  public String[] WEEKDAY_LONG = "Sunday""Monday""Tuesday",
          "Wednesday""Thursday""Friday""Saturday" };

  public String[] WEEKDAY_SHORT = "Sun""Mon""Tue""Wed""Thu""Fri",
          "Sat" };

  public static String getAM() {
      return AM;
    }

  public static String getPM() {
      return PM;
    }

  public String[] getWEEKDAY_LONG() {
    return WEEKDAY_LONG;
  }

  public String[] getWEEKDAY_SHORT() {
    return WEEKDAY_SHORT;
  }

}


           
       
Related examples in the same category
1.Implement SimpleDateFormat for GWT
2.A simple regular expression based parser for date notations
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.