- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Does anyone have a date picker widget in JSL (like https://jqueryui.com/datepicker/) that could be put into a New Window user dialog?
Does anyone have a date picker widget in JSL (like https://jqueryui.com/datepicker/) that could be put into a New Window user dialog?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Does anyone have a date picker widget in JSL (like https://jqueryui.com/datepicker/) that could be put into a New Window user dialog?
newwindow("date demo", d=numbereditbox(77,9,<<setformat(Format( "Monddyyyy h:m:s", 22, 0 ))));
when the number edit has a date format assigned, rolling over it with the mouse shows a blue triangle. Click the triangle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Does anyone have a date picker widget in JSL (like https://jqueryui.com/datepicker/) that could be put into a New Window user dialog?
newwindow("date demo", d=numbereditbox(77,9,<<setformat(Format( "Monddyyyy h:m:s", 22, 0 ))));
when the number edit has a date format assigned, rolling over it with the mouse shows a blue triangle. Click the triangle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Does anyone have a date picker widget in JSL (like https://jqueryui.com/datepicker/) that could be put into a New Window user dialog?
Thanks for the quick reply from many pointing me to this built-in feature. I now see this is mentioned at Constructing Display Trees
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Does anyone have a date picker widget in JSL (like https://jqueryui.com/datepicker/) that could be put into a New Window user dialog?
JMP 11 and 12 comes with a built-in date picker for numbereditboxes:
nw = new window("Example Date Picker",
hlistbox(
textbox("Choose a date: "),
dteb = numbereditbox(0),
),
ok_button = button box("OK", date_value = dteb << get),
dteb << set format(format("ddMonyyyy")),
dteb << set width(12),
dteb << set(today()),
);
If this doesn't suit your needs I posted a calendar dialog box a while back in the file exchange, but it looks like it's been removed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Does anyone have a date picker widget in JSL (like https://jqueryui.com/datepicker/) that could be put into a New Window user dialog?
Adding onto Craig's answer, here is a "date_box()" that you can call to make it do that functionality as well. This also defaults to a date so it doesn't just blank out if you accidentally insert insert a character or something.
date_box = function(//makes a calendar come up on a numeditbox that is a little more robust
//Note, this only works on JMP 11+
{timething = Today()}, {newbox},
newbox = Eval(substitute(NameExpr(number edit box(timething, //Eval(Sub()) because of JMP quirk
10,//just need this because JMP doesn't default a width
<<Set function(function({self},{},
if(ismissing(self<<get),
self<<Set(Eval(DUMMY))//sets the date to the timething argument
)
)),
<<Set Format(Format("m/d/y h:m:s", 23, 0));//makes datetime format for the box (gives calendar)
)), EXPR(DUMMY), timething));
newbox;
);
then you can just :
nw = new window("Date Box",
date_box(), //defaults to now
date_box(Today()-5*60*60), // Set to 5 hours ago
);