Hi All, I am trying to implement a date parameter ...
# prefect-community
Hi All, I am trying to implement a date parameter in prefect UI like so
start_date = Parameter("start_date", default="2022-09-11")
What I see on the UI after registering the flow is in the first attached image. start_date shows up as string. What I’d like to see by default is in the second image, I’d like start_date to show up as date type instead of as string with the date time picker functionality. How can I achieve this?
1️⃣ 1
HI Sharvil, have you looked at https://docs-v1.prefect.io/api/latest/utilities/context.html#context-2? There is variable:
Copy code
scheduled_start_time	a datetime object representing the scheduled start time for the flow run; falls back to now for unscheduled runs
Hi Christopher, I don’t see any good examples in the doc to set Parameter to date type. How can context help with this, could you provide a code example?
all good now, this worked for me
start_date = Parameter("start_date", default="2012-04-23T18:25:43.511Z")
🙌 1