Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: error when using time part
uonline
Newbie

Posts: 1
Registered: 11/7/2003
Member Is Offline
posted on 11/7/2003 at 02:36 PM Reply With Quote
error when using time part


Hi,

Nice job!

But I got error after setting BUL_TIMECOMPONENT=true (calendar?.js) file I got error message like "Invalid year value: ..".

Cause: time part not removed from year part.

Solution: replace first code line inside function cal_prs_date1 (str_date) with:

var arr_dt = str_date.split(' ');
var arr_date = str_dt[0].split('-');

B.t.w. I have also removed seconds value from time part, as follows:

// time generating function
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())
);
}

and:

// time parsing function
function cal_prs_time1 (str_time, dt_date) {

if (!dt_date) return null;
var arr_time = String(str_time ? str_time : '').split(':');

if (!arr_time[0]) dt_date.setHours(0);
else if (RE_NUM.exec(arr_time[0]))
if (arr_time[0] < 24) dt_date.setHours(arr_time[0]);
else return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed range is 00-23.");
else return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed values are unsigned integers.");

if (!arr_time[1]) dt_date.setMinutes(0);
else if (RE_NUM.exec(arr_time[1]))
if (arr_time[1] < 60) dt_date.setMinutes(arr_time[1]);
else return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed range is 00-59.");
else return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed values are unsigned integers.");

//if (!arr_time[2]) No Seconds needed! [CK]
dt_date.setSeconds(0);
//else if (RE_NUM.exec(arr_time[2]))
// if (arr_time[2] < 60) dt_date.setSeconds(arr_time[2]);
// else return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed range is 00-59.");
//else return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed values are unsigned integers.");

dt_date.setMilliseconds(0);
return dt_date;
}

Then I changed the size and maxlength of the input to 5 in stead of 8 chars (calendar.html, line 158)

And size=16 in the (your) used form input tag for the date+time value.

Regards.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004