Board Logo

date format
eve - 7/25/2005 at 08:30 AM

i ablet o call the calendar only if my textbox has no value.. If i want to update or change, i cant do it.. any 1 help.. thankz

me error message : 'undefined' is a nulll object

i have use the following code,

function cal_gen_time1 (dt_datetime) {
return (
(dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() + ":"
+ (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) + ":"
+ (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds())
);
}


function cal_prs_date1 (str_date) {

var arr_date = str_date.split('-');

if (arr_date.length != 3) return cal_error ("Invalid1 date format: '" + str_date + "'.nFormat accepted is dd-mm-yyyy.");
if (!arr_date[2]) return cal_error ("Invalid2 date format: '" + str_date + "'.nNo day of month value can be found.");
if (!RE_NUM.exec(arr_date[2])) return cal_error ("Invalid3 day of month value: '" + arr_date[2] + "'.nAllowed values are unsigned integers.");
if (!arr_date[1]) return cal_error ("Invalid4 date format: '" + str_date + "'.nNo month value can be found.");
if (!RE_NUM.exec(arr_date[1])) return cal_error ("Invalid5 month value: '" + arr_date[1] + "'.nAllowed values are unsigned integers.");
if (!arr_date[0]) return cal_error ("Invalid6 date format: '" + str_date + "'.nNo year value can be found.");
if (!RE_NUM.exec(arr_date[0])) return cal_error ("Invalid7 year value: '" + arr_date[0] + "'.nAllowed values are unsigned integers.");

var dt_date = new Date();
dt_date.setDate(1);

if (arr_date[1] < 1 || arr_date[1] > 12) return cal_error ("Invalid month value: '" + arr_date[1] + "'.nAllowed range is 01-12.");
dt_date.setMonth(arr_date[1]-1);

if (arr_date[0] < 100) arr_date[0] = Number(arr_date[0]) + (arr_date[0] < NUM_CENTYEAR ? 2000 : 1900);
dt_date.setFullYear(arr_date[0]);

var dt_numdays = new Date(arr_date[0], arr_date[1], 0);
dt_date.setDate(arr_date[2]);
if (dt_date.getMonth() != (arr_date[1]-1)) return cal_error ("Invalid day of month value: '" + arr_date[2] + "'.nAllowed range is 01-"+dt_numdays.getDate()+".");

return (dt_date)
}


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/