Hi Guys,
I have some code which takes the current date and splits it into dd, mm and yy variables.
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
if(dd<10){dd='0'+dd}
if(mm<10){mm='0'+mm}
this.rawValue = "Text, " + dd+ "-" + mm + "-" + yyyy;
I need to pass this a date from a date field instead of taking to days date but I cannot get it working.
var today = this.parent..DateTimeField2.rawValue;
var dd = today.getDate();
var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
if(dd<10){dd='0'+dd}
if(mm<10){mm='0'+mm}this.rawValue = "TEXT, " + dd+ "-" + mm + "-" + yyyy;
Any help would be appreciated.
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
you can use FormCalc and date patterns to do this easily.
Here an example for the calculate event of DateField2.
It grabs the formatted value of DateField1 (which is DD.MM.YYYY) and formats it to TEXT DD-MM-YYYY.
$ = Num2Date(Date2Num(DateField1.formattedValue, "DD.MM.YYYY"), "'TEXT ' DD-MM-YYYY")
Views
Replies
Total Likes
Hi,
you can use FormCalc and date patterns to do this easily.
Here an example for the calculate event of DateField2.
It grabs the formatted value of DateField1 (which is DD.MM.YYYY) and formats it to TEXT DD-MM-YYYY.
$ = Num2Date(Date2Num(DateField1.formattedValue, "DD.MM.YYYY"), "'TEXT ' DD-MM-YYYY")
Views
Replies
Total Likes
Works a treat!
Thanks radzmar!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies