PDA

View Full Version : Trimstring question-Dates



cobo
03-03-2008, 04:10 PM
Hi there,

I wonder if someone can help me ... I am modifying a booking calendar with date inputs for start and end stay. As you can tell from the programming below, the start and end boxes comes prefilled with the date February 27, 2008. Does anyone know what I can put in the string to make it show todays date. If I delete the 02-27-2008 it gives me an error that says the format is wrong, todays date will be used as default ... I just wish I knew how to actually program it. As if you can't tell I am new to JS.

DateInput('txtEndDate', true, 'DD-MON-YYYY', TrimString('02-27-2008'))

Thanks very much

CB

abduraooft
03-03-2008, 04:17 PM
I guess you are using http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm, where I see


DateInput(DateName, Required*, DateFormat*, DefaultDate*);
All parameters with a * are optional, and if not passed in a value, the default value is used.

DefaultDate :- STRING- optional. The default date displayed in the drop down menus. If none is specified, today's date is used.
You may require
DateInput('txtEndDate', true, 'DD-MON-YYYY') only!