Custom Date Fields

JED and DataTables allow you to format your Date fields any way you want. JED has a class named DateFormat. This class has a method named setCustomFormat(String datePattern). DateFormat uses class java.text.SimpleDateFormat internally, so you can base your datePattern parameter on the options provided in SimpleDateFormat.

Using the same table as the Field Validation example, we change the format for the Date field named "START_DATE". We are going to go with this pattern: (JQuery format: YYYY/M/D) (Java equivalent: yyyy/MM/dd).

View the JavaScript and Java tabs to see how we changed the date formatting.

Live example


FIRSTNAME LASTNAME EMAIL_ADDRESS START_DATE
Loading data from server
FIRSTNAME LASTNAME EMAIL_ADDRESS START_DATE


Javascript
HTML
Java
Includes