rash805115 / rnj

Online Shopping Portal
2 stars 3 forks source link

convert data in date field to a valid unix timestamp. #11

Open rash805115 opened 10 years ago

rash805115 commented 10 years ago

The date field must be converted into a valid timestamp before entering it into the DB. If it cannot be converted, then show error. The date field will only be in particular format.

The date field is in view/default/user/updateaccount.php The place to write code is in libs/auth/xuser.php inside the function setDOB()

a calendar function is needed in javascript inside /static/js/updateaccount.js

we also need to check if the date is in correct format.

shivamdixit commented 10 years ago

Can we use date.js to validate the date or we have to define our own function ? Checking for dates like 30/02/2000 will be a problem by simply using regex because it will pass the pattern but still it is not valid date !

http://www.datejs.com/

rash805115 commented 10 years ago

Date will be simple because for now as you said, we will be using some date function like date.js. The valid regex would depend on the format of date.js. I have not done this till now because I am already occupied with completing the project before November ends.

On Sun, Oct 27, 2013 at 5:05 PM, Shivam Dixit notifications@github.comwrote:

Can we use date.js to validate the date or we have to define our own function ? Checking for dates like 30/02/2000 will be a problem by simply using regex because it will pass the pattern but still it is not valid date !

http://www.datejs.com/

— Reply to this email directly or view it on GitHubhttps://github.com/rash805115/rnj/issues/11#issuecomment-27179302 .

Regards, Rahul Chaudhary Ph - 412-519-9634