Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

assign date field to ddmmyy variables

$
0
0

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!


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>