2022.2

Table Of Contents
Examples of masks
Value in raw data Mask to use
June25,2013 MMdd,YYYY
06/25/13 mm/dd/yy
2013.06.25 yyyy.mm.dd
2013-06-2507:31PM yyyy-mm-ddhh:nnap
2013-06-2519:31:14.1206 yyyy-mm-ddhh:nn:ss.ms
Tuesday,June25,2013@7h31PM DD,MMdd,yyyy@hh\hnnap
Entering a date using JavaScript
InseveralplacesintheDataMapper,DatevaluescanbesetthroughaJavaScript.Forexample:
l
InafieldintheDataModel.Todothis,gototheStepspaneandselectanExtractstep.Then,on
theSteppropertiespane,underFieldDefinitionclicktheAdd JavaScript Fieldbutton(nextto
theFieldListdrop-down).TypetheJavaScriptintheExpressionfield.(Torenamethefield,click
theOrderandrenamefieldsbutton.)
l
InaPreprocessor property.Todothis,gototheStepspaneandselectthePreprocessorstep.
Then,ontheSteppropertiespane,underPropertiesaddaproperty,specifyitsTypeasDateand
puttheJavaScriptintheDefaultValuefield.
TheuseoftheJavaScriptDate()objectisnecessarywhencreatingdatesthroughaJavaScriptexpres-
sion.Formoreinformation,seew3schools-JavaScriptDatesandw3schools-DateObject.
Example: Thefollowingscriptcreatesadatethatisthecurrentdate+30days:
function addDays(date, days) {
var result = new Date(date);
result.setDate(result.getDate() + days);
return result;
}
addDays(new Date(), 30);
Page 280