# Node to pick a date

**URL:** https://discourse.nodered.org/t/node-to-pick-a-date/56256
**Category:** General
**Created:** [7 January 2022 14:07 UTC](https://discourse.nodered.org/t/node-to-pick-a-date/56256 "2022-01-07T14:07:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)
#### Post date: [7 January 2022 14:07 UTC](https://discourse.nodered.org/t/node-to-pick-a-date/56256/1 "2022-01-07T14:07:23Z")

</div>

Hi everybody,

I need to have a node that can do this 3 think:  
Pick a complete specific date (day, month, year) or pick only a specific month and year or pick only a specific year. Once that the choiche was made, with a button, inject the value.

Is possible to do this? Is a few weeks that I try, but I am not able to do this

Thanks in advance  
Mario

---

<div class="post-metadata">

### Author: ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)
#### Post date: [11 January 2022 16:45 UTC](https://discourse.nodered.org/t/node-to-pick-a-date/56256/2 "2022-01-11T16:45:38Z")

</div>

No one has a solution?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [11 January 2022 16:57 UTC](https://discourse.nodered.org/t/node-to-pick-a-date/56256/3 "2022-01-11T16:57:06Z")

</div>

I assume you mean that you want to use Dashboard?

Have you looked at the Date Picker?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [11 January 2022 17:26 UTC](https://discourse.nodered.org/t/node-to-pick-a-date/56256/4 "2022-01-11T17:26:57Z")

</div>

I think you will have to combine two dashboard nodes to get the formats you wish.

Here is a simple example of how you could use ui-Datepicker with ui-Dropdown to get the output you wish.

```auto
[{"id":"ce016f13.d322c8","type":"ui_dropdown","z":"c791cbc0.84f648","name":"","label":"type","tooltip":"","place":"Select option","group":"b9d366f18ff7ae74","order":3,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"DD/MM/YYYY","value":"DD/MM/yyyy","type":"str"},{"label":"MM/YYYY","value":"MM/yyyy","type":"str"},{"label":"YYYY","value":"yyyy","type":"str"}],"payload":"","topic":"pattern","topicType":"str","x":110,"y":840,"wires":[["7e222590.96d6f4"]]},{"id":"7e222590.96d6f4","type":"join","z":"c791cbc0.84f648","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":270,"y":860,"wires":[["d49d158f.301768"]]},{"id":"4008c433.47e9ac","type":"ui_date_picker","z":"c791cbc0.84f648","name":"","label":"date","group":"b9d366f18ff7ae74","order":4,"width":0,"height":0,"passthru":true,"topic":"date","topicType":"str","x":110,"y":900,"wires":[["7e222590.96d6f4"]]},{"id":"d49d158f.301768","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment($$.payload.date).format($$.payload.pattern)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":860,"wires":[["8590d7c7.6d8108"]]},{"id":"8590d7c7.6d8108","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":960,"wires":[]},{"id":"b9d366f18ff7ae74","type":"ui_group","name":"test","tab":"ffba43d73860d25d","order":1,"disp":true,"width":"6","collapse":false},{"id":"ffba43d73860d25d","type":"ui_tab","name":"Level","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

```

or a ui-Form, the output uses the first checkbox that is checked, counting from top to bottom . So if you check two the first is the one used.

```auto
[{"id":"7725d590.63fbec","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"date\":\"2022-01-19T00:00:00.000Z\",\"p0\":\"\",\"p1\":true,\"p2\":\"\"}","payloadType":"json","x":120,"y":800,"wires":[["6a72670e.d94238"]]},{"id":"6a72670e.d94238","type":"ui_form","z":"c791cbc0.84f648","name":"","label":"","group":"b9d366f18ff7ae74","order":16,"width":0,"height":0,"options":[{"label":"Pick a date","value":"date","type":"date","required":true,"rows":null},{"label":"DD/MM/YYYY","value":"p0","type":"checkbox","required":false,"rows":null},{"label":"MM/YYYY","value":"p1","type":"checkbox","required":false,"rows":null},{"label":"YYYY","value":"p2","type":"checkbox","required":false,"rows":null}],"formValue":{"date":"","p0":false,"p1":false,"p2":false},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","x":170,"y":860,"wires":[["d49d158f.301768"]]},{"id":"d49d158f.301768","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment($$.payload.date).format(\t $lookup(\t {\t \"p0\":\"DD/MM/yyyy\",\t \"p1\":\"MM/yyyy\",\t \"p2\":\"yyyy\"\t },\t [$keys(\t $sift($$.payload, function($v,$k){$v = true})\t )][0]\t )\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":860,"wires":[["8590d7c7.6d8108"]]},{"id":"8590d7c7.6d8108","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":860,"wires":[]},{"id":"b9d366f18ff7ae74","type":"ui_group","name":"test","tab":"ffba43d73860d25d","order":1,"disp":true,"width":"6","collapse":false},{"id":"ffba43d73860d25d","type":"ui_tab","name":"Level","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)
#### Post date: [11 January 2022 19:26 UTC](https://discourse.nodered.org/t/node-to-pick-a-date/56256/5 "2022-01-11T19:26:34Z")

</div>

Thanks for reply. Tomorrow I will try your solutions.  
Thank you for now

Mario

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [12 March 2022 19:27 UTC](https://discourse.nodered.org/t/node-to-pick-a-date/56256/6 "2022-03-12T19:27:33Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
