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: Changing dd-mm-yyyy to dd/mm/yyyy
alunr
Newbie

Posts: 1
Registered: 2/27/2003
Member Is Offline
posted on 2/27/2003 at 07:38 PM Reply With Quote
Changing dd-mm-yyyy to dd/mm/yyyy


I need to change the accepted date format and the output format to be able to store the data in my database.

How can I do this or do I need the PRO version?
View User's Profile View All Posts By User U2U Member
nik


Posts:
Registered: 1/1/1970
Member Is Offline
posted on 2/28/2003 at 01:42 PM Reply With Quote

You should just revise file calendar1.js. To change input format line 101 is changed from:

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

to:

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

To alter output format lines 69 and 70 ( cal_gen_date1 function body) are changed from:

(dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + "-"
+ (dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "-"

to:

(dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + "/"
+ (dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "/"
View User's Profile View All Posts By User U2U Member
deepak
Junior Member

Posts: 2
Registered: 2/21/2003
Location: India
Member Is Offline
posted on 3/6/2003 at 06:31 AM Reply With Quote
Date Formats


Hi there,

Different Databases have different formats. Like Oracle prefers:

dd-Mon-YYYY

MySQL prefers YYYY-MM-DD

Perhaps we can set one object to detect the requirement and then where to append the necessary formatting and return of values in calender1/calender2.js files?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/8/2003 at 11:54 AM Reply With Quote

This approach is already implemented in PRO version of the product. It has separate files for date conversion routines. Numerous date format filters come with the package. You just need to link the one you need. This can be done dynamically.

Note: Yes, you can switch different date formats on the client-side, but this isn't very good idea: before passing any data to database you should validate it on the server side for security and robustness reasons. Having different date formats requires different validators on the server side. Better idea is to stick to some format dates are passed to server side and convert them to format database accepts after the validation.
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