Message Boards Message Boards

0
|
6605 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Create interface with date and time picker as an input type?

Posted 3 years ago

Need a widget like a Date/Time Picker used to enter date and time for Medical Calculations. I cannot find it in the documentation. Second, having trouble creating a Date calculation that finds the difference in two date times in the interval of hours. Example Time the lab is drawn Minus the date/time of birth to determine the age in hours.
Anyone that can give me code snippets for these two issues.

POSTED BY: Timothy Hartzog
5 Replies

Hi. This should help you with the date part of your question.

todateobject[dateinput_] := Interpreter["Date"][dateinput] /. Failure[y__] :> Missing[];
simpledatesetter[Dynamic[x_]] := DynamicModule[{t = x},
DynamicWrapper[ InputField[Dynamic[t], String, ContinuousAction -> False], 
x = todateobject[t], TrackedSymbols :> {t}]];
Column[{simpledatesetter[Dynamic[x]], Dynamic@x}]
POSTED BY: Emerson Willard
Posted 3 years ago

Hi Timothy,

For this

Second, having trouble creating a Date calculation that finds the difference in two date times in the interval of hours.

DateDifference[{2021, 3, 1, 12, 0, 0}, Now, "Hours"]
(* Quantity[654.776, "Hours"] *)
POSTED BY: Rohit Namjoshi

Thank you,
I have read the documentation, i still cannot figure out how to create interactive user interfaces, any suggestion to a blog post or article for a newbie.

It would be nice if they had user interface widgets like common Javascript libraries.

POSTED BY: Timothy Hartzog
Posted 3 years ago

Maybe this or this.

POSTED BY: Rohit Namjoshi
Posted 3 years ago
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract