# Time and date control

**URL:** https://forums.losant.com/t/time-and-date-control/863
**Category:** Feature Request
**Created:** [April 10, 2018, 8:24pm UTC](https://forums.losant.com/t/time-and-date-control/863 "2018-04-10T20:24:56Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)
#### Post date: [April 10, 2018, 8:24pm UTC](https://forums.losant.com/t/time-and-date-control/863/1 "2018-04-10T20:24:56Z")

</div>

Hi  
would it be possible to add to the input control blocks a standard date selector (calendar with year/month/day selection) and time (hour/minute/ AM/PM 12/24H config etc.) selectors?  
I suggest having 1) a comprehensive result string 2)individual properties for day/month/hr/min/sec… and c) a standard seconds from epoch property

I would also like to have a parallel display and the capability to push these properties INTO a control as described above.  
Thanks  
Uri

---

<div class="post-metadata">

### Author: ![Erin\_Thompson](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/erin_thompson/32/501_2.png) [@Erin\_Thompson](https://forums.losant.com/u/Erin_Thompson)
#### Post date: [April 12, 2018, 3:15pm UTC](https://forums.losant.com/t/time-and-date-control/863/2 "2018-04-12T15:15:21Z")

</div>

Hi Uri,

That is a great feature request, and we already have a ticket for it! 🙂 We will post back when the feature is released.

Thanks,  
Erin

---

<div class="post-metadata">

### Author: ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)
#### Post date: [April 12, 2018, 5:16pm UTC](https://forums.losant.com/t/time-and-date-control/863/3 "2018-04-12T17:16:27Z")

</div>

any guestimate as for availability?

---

<div class="post-metadata">

### Author: ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)
#### Post date: [April 19, 2020, 7:13am UTC](https://forums.losant.com/t/time-and-date-control/863/4 "2020-04-19T07:13:44Z")

</div>

Hello Erin  
Any update on this? I have an IoT device which controls a timed switch. I need to program it’s time-on and time-off variables.  
Thanks  
Uri

---

<div class="post-metadata">

### Author: ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)
#### Post date: [April 19, 2020, 11:49pm UTC](https://forums.losant.com/t/time-and-date-control/863/5 "2020-04-19T23:49:33Z")

</div>

Hey Uri! This feature is still in the backlog.

However since your original request, we have released the [Custom HTML Block](https://docs.losant.com/dashboards/custom-html/), which does provide you a workaround.

With the Custom HTML Block, you can create any input form you want and POST the data to a Webhook or an Experience Endpoint.

To make things easier, I created a template you can [import](https://docs.losant.com/applications/import-export/#importing-an-application) that demonstrates this using a Date Time picker.

[template-input-form.zip](https://forums.losant.com/uploads/short-url/wrJtlEyznNFcNOQC34Y0Z7B9Kdp.zip) (36.8 KB)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/8/8180cae2ce144c8fadc4e45f1eccb53cfdbac227.png)

This template uses a Custom HTML Block built with [Bootstrap](https://getbootstrap.com/docs/3.4/) and [jQuery](https://jquery.com/).

I Googled and picked the first [jQuery Date Time picker](https://github.com/xdan/datetimepicker/tree/2.5.19) I found, but feel free to explore others.

To make this secure, I also added [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication) between the dashboard and the experience endpoint. This way, only people with access to your dashboard would be able to POST data to your experience endpoint.

---

<div class="post-metadata">

### Author: ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)
#### Post date: [April 20, 2020, 6:33am UTC](https://forums.losant.com/t/time-and-date-control/863/6 "2020-04-20T06:33:42Z")

</div>

wow, that looks just like what I need, only, I am not sure how I send the output to my device… I am not a web programmer, but a poor C guy from home… Can you guide me please?  
Thanks

Uri

---

<div class="post-metadata">

### Author: ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)
#### Post date: [April 20, 2020, 2:12pm UTC](https://forums.losant.com/t/time-and-date-control/863/7 "2020-04-20T14:12:46Z")

</div>

@Uri_Bear,

Sure! I can help. The template Brandon sent was not the final product. But, it does give you the building blocks to solve this problem.

Open up the Custom HTML Block settings. The snippet below was pulled from the “Custom Body Content.”

```auto
$.ajax({
      type: 'POST',
      url:'https://5e9cd557b9d41000062b25d6.onlosant.com/input-form',
      data: $('#target').serialize(),
      beforeSend: appendAuth,
      error: () => { showMessage('#error') },
      success: () => { showMessage('#success') }
    });

```

When the form in the block is submitted, the code above will run. It makes an [HTTP POST request](https://api.jquery.com/jquery.ajax/) to the URL of `https://5e9cd557b9d41000062b25d6.onlosant.com/input-form`, and the body of the post request will be the form data.

As you can see, that’s an `onlosant` URL, which means it’s an [Experience Endpoint](https://docs.losant.com/experiences/endpoints/).

In the template, there is a workflow called “Workflow - POST /input-form.”

Now, here is what you need to do to get this to work for you:

- Update the form to be the data you want to collect.
- Update the Experience Workflow to perform the action desired once data is received. For example, use the Device Command Node to send the form data to your device.

To change the form, you’ll have to change the HTML, CSS, or JS in the block settings. However, here are some great resources to help:

- [https://www.w3schools.com/](https://www.w3schools.com/)
- [https://developer.mozilla.org/en-US/](https://developer.mozilla.org/en-US/)
- [https://eloquentjavascript.net/](https://eloquentjavascript.net/)
- [https://www.freecodecamp.org/learn](https://www.freecodecamp.org/learn)

---

<div class="post-metadata">

### Author: ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)
#### Post date: [April 20, 2020, 2:43pm UTC](https://forums.losant.com/t/time-and-date-control/863/8 "2020-04-20T14:43:46Z")

</div>

Hi  
Can we connect on some screenshare platform? I need a little more hands on help.

I am on Israel time, best hours are 9 to 10 PM but I will try to accommodate any time.

Thanks

Uri

---

<div class="post-metadata">

### Author: ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)
#### Post date: [April 20, 2020, 2:48pm UTC](https://forums.losant.com/t/time-and-date-control/863/9 "2020-04-20T14:48:39Z")

</div>

@Uri_Bear,

Unfortunately, no we can’t :(. However, If you can explain where you’re struggling, I can try my best to point you to the right resources.

Overall, I recommend, checking out the links I sent above. Having some understanding of HTML, CSS, or JS is key to building within the Custom HTML Block.

---

<div class="post-metadata">

### Author: ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)
#### Post date: [April 21, 2020, 9:24am UTC](https://forums.losant.com/t/time-and-date-control/863/10 "2020-04-21T09:24:51Z")

</div>

OK.  
I will try.

The first thing I came up with is that I do not seem to have an import button in my applications list - so cannot import the proposed template.

Second: copied the suggested code into the body section - the gui just showed the code, nothing else.  
Uri

---

<div class="post-metadata">

### Author: ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)
#### Post date: [April 21, 2020, 2:24pm UTC](https://forums.losant.com/t/time-and-date-control/863/11 "2020-04-21T14:24:26Z")

</div>

Hey Uri, the import button is on the application list found on your sandbox or organization overview page. The sandbox overview page, for example, can be found by clicking your account icon on the bottom left of the screen.

---

<div class="post-metadata">

### Author: ![Uri\_Bear](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Uri\_Bear](https://forums.losant.com/u/Uri_Bear)
#### Post date: [April 23, 2020, 5:29pm UTC](https://forums.losant.com/t/time-and-date-control/863/12 "2020-04-23T17:29:39Z")

</div>

Thank you Brandon & Team, you are AWESOME!  
All is working well!

Thanks

Uri

---

<div class="post-metadata">

### Author: ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)
#### Post date: [April 23, 2020, 5:55pm UTC](https://forums.losant.com/t/time-and-date-control/863/13 "2020-04-23T17:55:18Z")

</div>

Glad to hear that Uri!
