close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

datepicker date format for european use and date conversion in the table field

Thread began 3/15/2010 8:05 am by davas56386677 | Last modified 3/18/2010 10:49 am by Dani Chankhour | 3249 views | 3 replies |

davas56386677

datepicker date format for european use and date conversion in the table field

Hello,
Does anybody have an idea how I can resolve the following problem in PowerStore 3 coupons_Insert.php and couons_Update.php to store the CouponStartDate and the CouponEndDate with the format required by the corresponding field in the coupons table.
As I needed to localize PW3 to French (and later to German) I had to modify the jquery-ui-1.7.1.custom.min.js file in CSSFormBuilder according to the instructions published on the jQUERY site (UI/Datepicker/formatDate) for the datepicker function and so on, to be able to use the European date input (dd/mm/yy) (e.g. 24 mars 2010 for 24th march 2010)
I also modified the CouponStartDate_Spry and the CouponEndDate_Spry to format:'dd/mm/yyyy'.
Everything works fine on the page in the browser. The datepicker reacts as it should for European date and stores e.g. 28/03/2010 (for 28th march 2010). It validates correctly in the form field on the screen.
But when it comes to store that date into the field of the database (MySQL), then the date stored is 01/01/1970, which in turn indicate that the .((isset($_POST["CouponStartDate"]))?date('Y-m-d',strtotime($_POST["CouponStartDate"])):"") ."" function in the query of coupons_Insert.php did not work fine.
Some type of string conversion or manipulation must be done (and furthermore also in coupons_Update.php) to store the date with the format needed in the table’s date field.
Should I issue a mysql_query("SET lc_time_names = 'fr_FR'"); before runnin the actual query. I’m not sure that it will solve my problem.
Any help is welcome

Sign in to reply to this post

Dani Chankhour

There is some conversion that needs to be done before storing the date in the database since the format changed. In this thread you could see there is a helper file that you need to include on the top of the page which have the conversion function you need to use:

showpost.php?p=43530&postcount=20

let me know if you still have questions.

Sign in to reply to this post

davas56386677

datepicker and dateformat.php

Hi Dani,

Nice getting back with you.
Thanks for the zip file
Works perfectly but please correct slightly the function date_uk_to_american($date) in dateformat.php to:

$months = implode_range('|',0,12,true);
$days = implode_range('|',0,31,true);

and then it works smoothly as expected.

Again many thanks for your professional assistance

Dan

Sign in to reply to this post

Dani Chankhour

I'm glad i was able to help and thank for posting back with the correction.

Thanks.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...