Project

General

Profile

Automatic dates (client side) » History » Version 4

« Previous - Version 4/8 (diff) - Next » - Current version
Elie Soubrie, 22/03/2012 10:23


Automatic dates (client side)

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

    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
        });