cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robby Pelssers <>
Subject RE: 2.1 Cocoon Forms Formatting Date in Flow
Date Mon, 24 Sep 2012 07:00:33 GMT
Hi Peter,

Are you sending the mail from flowscript?  I think the formatting is only used for the form
itself but you will still receive a regular Date object on the server side.  So you probably
need to format it on the server side using plain java.


var startDate = get date from form
var df = new SimpleDateFormat("dd/MM/yyyy") ;
var formatted = df.format(startDate);

use the formatted date in your sendmail template


From: Peter D Sparkes [] 
Sent: Sunday, September 23, 2012 11:15 PM
To: Cocoon users
Subject: 2.1 Cocoon Forms Formatting Date in Flow

In my model I have:

<fd:field id="startdate" required="true">
       <fd:label>Start Date:</fd:label>
        <fd:datatype base="date">
              <fd:convertor type="formatting">

In my js I have:
function enquiry() {
form.showForm("enquiry-display-pipeline" );
var startdate =model.startdate;
I then put startdate into an email and send it
The received email has the startdate  as eg 
Mon Aug 27 00:00:00 BST 2012
Please, how can I format it as 27/0/2012 or get rid of the 

00:00:00 BST



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message