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 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Nilesh ShahRank #42 · 34.2K reputationPosted May 17, 2017, 8:17 AM EDT