Click here to Skip to main content
       

JavaScript

 
AnswerRe: Draw circuit diagram using javascript Pinmembern.podbielski19-Nov-12 21:07 
Answerto transfer items in select list to another select list without duplicates Pinmemberraviteja999200014-Nov-12 20:09 
QuestionHow does Yandex do its trick? PinmemberXarzu14-Nov-12 19:42 
AnswerRe: How does Yandex do its trick? [modified] PinmvpManfred R. Bihy14-Nov-12 20:44 
Questiondisplay record from two different time Pinmemberuti123fil8-Nov-12 17:15 
AnswerRe: display record from two different time PinmvpRichard MacCutchan8-Nov-12 23:47 
QuestionAdding a month to the current date PinmemberSadiqMohammed6-Nov-12 23:48 
AnswerRe: Adding a month to the current date PinmemberRichard Deeming7-Nov-12 2:00 
SadiqMohammed wrote:
if (expiration_date.getMonth() == 0)
expiration_date = expiration_date.getMonth() + 1 + "/" + expiration_date.getDate() + "/" + expiration_date.getFullYear();
else
expiration_date = expiration_date.getMonth() + "/" + expiration_date.getDate() + "/" + expiration_date.getFullYear();

 
There's your problem - in Javascript, months run from 0 to 11, not 1 to 12. If the new date is in January, you're setting the result correctly; otherwise, you're setting it to the previous month.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Adding a month to the current date PinmemberSadiqMohammed7-Nov-12 18:31 
GeneralRe: Adding a month to the current date PinmemberRichard Deeming8-Nov-12 2:11 
GeneralRe: Adding a month to the current date PinmemberSadiqMohammed8-Nov-12 19:08 
AnswerRe: Adding a month to the current date Pinmemberdeepak.m.shrma19-Nov-12 18:07 
GeneralRe: Adding a month to the current date PinmemberPeter_in_278019-Nov-12 18:58 
GeneralRe: Adding a month to the current date Pinmemberdeepak.m.shrma19-Nov-12 19:52 
QuestionNeed to pass object value from javascript to php Pinmembergern844-Nov-12 10:08 
SuggestionRe: Need to pass object value from javascript to php Pinmembern.podbielski4-Nov-12 12:56 
GeneralRe: Need to pass object value from javascript to php Pinmembergern844-Nov-12 13:29 
GeneralRe: Need to pass object value from javascript to php Pinmembern.podbielski4-Nov-12 20:48 
GeneralRe: Need to pass object value from javascript to php Pinmemberzengnanhua22-Nov-12 18:27 
GeneralRe: Need to pass object value from javascript to php PinmemberKillzone DeathMan22-Nov-12 23:39 
QuestionWindow restore Pinmembermkotaska1-Nov-12 6:00 
AnswerRe: Window restore Pinmemberryanb312-Nov-12 11:03 
Questionunzip the .gzip files [modified] PinmemberKIDYA31-Oct-12 19:44 
AnswerRe: unzip the .gzip files PinmemberJay Zhu2-Nov-12 17:20 
Questioni have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. PinmemberAbhishek Prakash30-Oct-12 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 19 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid