I searched for this but didnt come up with anything…
I’m working on a smartapp – In the preferences section I have defined a date type input. When this is run, and you focus on that field, you just get a keyboard, rather than a datepicker of some sort. For ‘time’ type fields, I’ve noticed you get a simple time picker.
This is both in the simulator and in android app, so I don’t think that it is a bug in the simulator.
Am I missing something? The date input gives no indication of the format of date required either.
@jacobrichard did you figure this out, I’m facing the same issue. When I enter type “date” I get a keyboard input with no indication on format.
@Jim - can you comment on this from a docs point, what is the expected format for input “date” and what is the expected screen layout for the user - wondering if we are using this correctly since I can’t find examples using dates either.
Yep, I’m looking into it. As you have noticed, we don’t have a date picker. It may be that we need to remove this from the documentation. I’ll follow up.
I am curious about the use case for specifying a date value in a preference. Can people share their requirements? Is it to execute something only on a certain day in the future, or…?
We’ve removed the date type from the supported input types documentation. It should never have been there. My apologies for the confusion.
We don’t have support for input types of date. If people can share their use cases, we can pass them on to our product team for future consideration.
Sorry again for the confusion!
I’m working on a lock manager that could benefit from a date field. The idea is a vacation home landlord, such as someone who does Air B&B could then choose a date to start code access, and also a date to end code access automatically with my app.
As it is now, I’ll have to ask for each day/month/year individually, parse that into a date and then somehow add time to it, either with the time field and parse out the date (since the time field also captures a date… argh) or ask for yet alother individual value: 24 hour time… such as 1300, or 1301 for 1:00pm, or 1:01pm respectively. Not the most user friendly experience, and definitely not fun to program these dateTimes out manually.
Here’s a code example of the input: Input Preference Fields
Here’s how I got around to parsing the date with the time input field cut in: Parse Date Method
Here’s the schedule call for the parsed dateTime: Run Once Method
Kind of dirty, but it works.
Another vote for a date type input. My Smartapp will let me trigger an event (thermostat to mode/temp) once at a specific date and time and then confirm it a few hours later. I’ve reused the great code @ethayer shared to get it working for now but a date or date+time input type would be much more user friendly.