Hi folks,
I would like to extract the year part of my datefiedl's selected value.
For example, I would like to get 2010 from : 23/12/2010
And check if the extracted year is smaller than the current year.
How can I do it in LiveCycle(JavaScript is preferred)?
Thank you,
Yair
Solved! Go to Solution.
Views
Replies
Total Likes
var Input = Num2Date(Date2Num($.formattedValue, "DD.MM.YYYY"),"YYYY")
var CurrentYear = Num2Date(date(), "YYYY")
if (Input ne CurrentYear) then
xfa.host.messageBox("Wrong Year")
endif
radzmar
Views
Replies
Total Likes
You can do this with FormCalc in the exit:Event of the date field.
var Input = Num2Date(Date2Num($.formattedValue, "DD/MM/YYYY"), "YYYY")
if (Input ne 2010) then
xfa.host.messageBox("Wrong Year selected")
endif
Views
Replies
Total Likes
Thank you,
How can I get the current year in code?
Yair
Views
Replies
Total Likes
var Input = Num2Date(Date2Num($.formattedValue, "DD.MM.YYYY"),"YYYY")
var CurrentYear = Num2Date(date(), "YYYY")
if (Input ne CurrentYear) then
xfa.host.messageBox("Wrong Year")
endif
radzmar
Views
Replies
Total Likes
Thank you man.
Views
Replies
Total Likes