Project

General

Profile

Automatic dates (client side) » History » Version 5

Version 4 (Elie Soubrie, 22/03/2012 10:23) → Version 5/8 (Elie Soubrie, 22/03/2012 10:24)

h1. Automatic dates (client side)

Ajout dans le fichier source:workspace/client-public/js/components/commons/forms/components/singleSelection/DateBeetween.js (@2#L37) source:workspace/client-public/js/components/commons/forms/components/singleSelection/DateBeetween.js@2#L37

<pre><code class="javascript">
var date1 = new Date();
var numberOfDaysToRemove= 8;
date1.setDate(date1.getDate()-numberOfDaysToRemove);
date1.setHours(0, 0, 0, 0)
this.fieldFrom = new Ext.form.DateField({
allowBlank : true,
format : dateFormat,
flex : 1,
//height : this.height,
//value : new Date(this.defaultValues[0]).format(dateFormat),
//value : new Date("2010/09/02 23:00:00").format(dateFormat),
value : date1.format(dateFormat),
showTime : this.showTime
});
var date2 = new Date();
date2.setHours(0, 0, 0, 0);
this.fieldTo = new Ext.form.DateField({
allowBlank : true,
format : dateFormat,
flex : 1,
//height : this.height,
//value : new Date(this.defaultValues[1]).format(dateFormat),
value : date2.format(dateFormat),
showTime : this.showTime
});
</code></pre>