Hi ,
I am migrating code from Javascript to TypeScript
I have the following
function myDateDialog()
{
var retDay;
var retMonth;
var retYear;
}
function openDatePickerDialog(wnd, field, dateFormat) {
myDateDialog.retDay = "";
myDateDialog.retMonth = "";
myDateDialog.retYear = "";
var dlgURL = '../DatePicker.htm';
field.value = dateFormat.replace(/yyyy/, myDateDialog.retYear).replace(/MM/, myDateDialog.retMonth).replace(/dd/, myDateDialog.retDay);
what would be the best to replace the Javascript code
function myDateDialog() , would a class be best and declare retDay , retMonth and retYear as properties ?
Then instantiate the class in openDatePickerDialog and set the properties values ?
or is there a better approach ?
Thanks
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nilesh ShahPosted May 17, 2017, 12:17 PM