My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.vineetmanohar.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
* ${formatDate["MMM dd, yyyy HH:mm"][user.creationDate]}
*
* @author Vineet Manohar
*
*/
public class FormatDate extends ELMethod {
private static final long serialVersionUID = 1L;

public FormatDate() {
super(2);
}

public Object result(Object[] args) {
String pattern = (String) args[0];
Date date = (Date) args[1];

return new SimpleDateFormat(pattern).format(date);
}
}

Change log

r12 by vineet.manohar on Jul 13, 2010   Diff
added el method an example child classes
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 489 bytes, 25 lines
Powered by Google Project Hosting