Click here to Skip to main content
15,918,330 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Javescript Pin
ZurdoDev25-Mar-14 4:40
professionalZurdoDev25-Mar-14 4:40 
QuestionSCRIPT5009: 'isCheckSign' is undefined Pin
guiyuan.dong20-Mar-14 17:53
guiyuan.dong20-Mar-14 17:53 
AnswerRe: SCRIPT5009: 'isCheckSign' is undefined Pin
ZurdoDev24-Mar-14 8:40
professionalZurdoDev24-Mar-14 8:40 
GeneralRe: SCRIPT5009: 'isCheckSign' is undefined Pin
guiyuan.dong26-Mar-14 18:04
guiyuan.dong26-Mar-14 18:04 
GeneralRe: SCRIPT5009: 'isCheckSign' is undefined Pin
Richard Deeming27-Mar-14 2:32
mveRichard Deeming27-Mar-14 2:32 
GeneralRe: SCRIPT5009: 'isCheckSign' is undefined Pin
guiyuan.dong27-Mar-14 22:47
guiyuan.dong27-Mar-14 22:47 
GeneralRe: SCRIPT5009: 'isCheckSign' is undefined Pin
ZurdoDev27-Mar-14 3:35
professionalZurdoDev27-Mar-14 3:35 
GeneralRe: SCRIPT5009: 'isCheckSign' is undefined Pin
guiyuan.dong27-Mar-14 22:51
guiyuan.dong27-Mar-14 22:51 
GeneralRe: SCRIPT5009: 'isCheckSign' is undefined Pin
ZurdoDev28-Mar-14 1:17
professionalZurdoDev28-Mar-14 1:17 
QuestionCreateJS, EaseJS Autocomplete Pin
Member 1068516219-Mar-14 23:45
Member 1068516219-Mar-14 23:45 
QuestionBlock thread Pin
Leng Vang18-Mar-14 5:40
Leng Vang18-Mar-14 5:40 
QuestionRe: Block thread Pin
ZurdoDev20-Mar-14 15:41
professionalZurdoDev20-Mar-14 15:41 
AnswerRe: Block thread Pin
Leng Vang24-Mar-14 6:12
Leng Vang24-Mar-14 6:12 
GeneralRe: Block thread Pin
ZurdoDev24-Mar-14 6:23
professionalZurdoDev24-Mar-14 6:23 
QuestionDate Validation Pin
AshBhande18-Mar-14 1:01
AshBhande18-Mar-14 1:01 
AnswerRe: Date Validation Pin
Richard MacCutchan18-Mar-14 6:59
mveRichard MacCutchan18-Mar-14 6:59 
AnswerRe: Date Validation Pin
ClimerChinna18-Mar-14 20:33
ClimerChinna18-Mar-14 20:33 
AnswerRe: Date Validation Pin
Praneet Nadkar4-May-14 22:46
Praneet Nadkar4-May-14 22:46 
Hi,
Did you mean

Start Date > (Now - 2 years)
End Date < (Now + 2 years)

instead of
Start Date > (Now - 2 years)
Start Date < (Now + 2 years)

also, Is it a validation or to be calculated.

I have not tested or ran the code, just gave it a try.

var duration = 2;
var startDate= new Date(); // You can take the input in here
var endDate = new Date(); // you can take the input end date here too.
var rollOutDate = new Date();

startDate.setFullYear( expiryDate.getFullYear() - duration );
endDate.setFullYear( expiryDate.getFullYear() + duration );

var difference = endDate - startDate;
var difference1 = rollOutDate - endDate; //i dont know which is greater here
var oneDay = 1000*60*60*24;
var oneYear = oneDay / 365;

var checkStartEndDate = Math.round(difference / oneYear); // in no of days
var checkRollEndDate = Math.round(difference1 / oneYear); // in no of days

if(checkStartEndDate < 2 && checkRollEndDate < 1 )
{
return true;
// You can also search and try the following
//Page.IsValid = true;
}

else
{
return false;
// You can also search and try the following
//Page.IsValid = false;
}

Apologies if I missed something.
QuestionFacebook share button is not working Pin
Member 803236014-Mar-14 21:46
Member 803236014-Mar-14 21:46 
AnswerRe: Facebook share button is not working Pin
ZurdoDev20-Mar-14 15:41
professionalZurdoDev20-Mar-14 15:41 
GeneralRe: Facebook share button is not working Pin
Sunasara Imdadhusen26-May-14 21:24
professionalSunasara Imdadhusen26-May-14 21:24 
Questionddslick set Max height Pin
saigowthami14-Mar-14 17:24
saigowthami14-Mar-14 17:24 
SuggestionRe: ddslick set Max height Pin
ZurdoDev20-Mar-14 15:43
professionalZurdoDev20-Mar-14 15:43 
Questionpop window Pin
Member 1003910910-Mar-14 20:33
Member 1003910910-Mar-14 20:33 
SuggestionRe: pop window Pin
ZurdoDev20-Mar-14 15:45
professionalZurdoDev20-Mar-14 15:45 

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

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