I want to set default dates in the the following date picker script, FROM 6 months back TO today.
What do I need to add or modify in the script below?
Names Default To Here( 1 );
clear log ();
New Window( "Query Date (last 6 months selected by default)",
<<Modal,
sd = Today();
ed = Today();
H List Box(
Text Box( "From:" ),
scal = Number Edit Box( sd, <<Set Format( Format( "yyyy-mm-dd" ) ), << SetFunction( Function( {this}, sd = scal << Get ) ), << Set Show Spin Box(1) ),
Spacer Box( Size( 20, 20 ) ),
Text Box( "To:" ),
ecal = Number Edit Box( ed, <<Set Format( Format( "yyyy-mm-dd" ) ), << SetFunction( Function( {this}, ed = ecal << Get ) ), << Set Show Spin Box(1) ),
);
);
sdt = Munger( Format Date( sd, "yyyy-mm-dd" ), 1, "T", " " );
edt = Munger( Format Date( ed, "yyyy-mm-dd" ), 1, "T", " " );
Show( sdt, edt );
When it's too good to be true, it's neither