# Node-red-contrib-simpletime enhancement

**URL:** <https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069>\
**Category:** Developing Nodes\
**Created:** [23 June 2020 12:38 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069 "2020-06-23T12:38:30Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 June 2020 09:50 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/21 "2020-06-28T09:50:16Z")

</div>

just keep an "old flow" with the old version of the node in it... then copy it to "test.json" and start `node-red test.json`... test and repeat...

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [28 June 2020 09:56 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/22 "2020-06-28T09:56:52Z")

</div>

This is all making my brain hurt a lot 😬

JFI I'm so messed up at my end that I've ended up with my main instance not even adding any propeties even when using the original 2.9.1 🙂

I've had to hide my axe 🙂

But its very educational.........................

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [28 June 2020 14:16 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/23 "2020-06-28T14:16:45Z")

</div>

I think I'm there at last 🙂

Basically tried installing a 2.9.1 version (on a clean alternate install) - just got original properties screen with no checkboxes

npm installed duff 2.9.3 - got checkbox properties with none pre-checked

npm installed 2.9.1 again - back to original screen

npm installed new 2.9.4 - got checkbox properties with all pre-checked

So hopefully that's a valid test sequence

New PR with 2.9.4 on its way - can you change to 2.9.5 when finally merged into master

Going for a lie down 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 June 2020 14:30 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/24 "2020-06-28T14:30:27Z")

</div>

Will it be released as 2.10.0 when it gets to npm?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [28 June 2020 14:31 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/25 "2020-06-28T14:31:35Z")

</div>

I've no idea - way above my pay grade 🙂

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [28 June 2020 15:36 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/26 "2020-06-28T15:36:09Z")

</div>

> [@cymplecy](#):
>
> I think I'm there at last 🙂

You certainly are! nice work & thank you.

> [@Colin](#):
>
> Will it be released as 2.10.0

Yes it will, as it includes backwards compatible functionality changes.  
Meanwhile, I'll bump it to v2.9.5 as Simon requested.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [28 June 2020 15:52 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/27 "2020-06-28T15:52:01Z")

</div>

I'll start on the extra property and the check/uncheck all feature after my fortnight holiday in the Maldives 🙂

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 June 2020 15:52 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/28 "2020-06-28T15:52:37Z")

</div>

yes as its a change/addition of function it should get a minor version bump on npm. hopefully all these test ones aren't on npm.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [28 June 2020 16:56 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/29 "2020-06-28T16:56:56Z")

</div>

> [@dceejay](#):
>
> hopefully all these test ones aren't on npm

No, it won't be updated on npm until all the changes are in.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [29 June 2020 22:18 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/30 "2020-06-29T22:18:14Z")

</div>

Ok - I've got a draft version which includes the extra yyyy-mm-dd propertie and two buttons to select/unselect all the checkboxes

it works (for me) BUT I couldn't find any nodes that use buttons so I'm a bit vary of doing a PR until others have had a say as to whether using plain buttons is good enough for a Node-RED node

What do people think?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/30b26231aea741190362825b65b9816aa5e0932d.jpeg)

My current development html file is here

> <https://github.com/cymplecy/node-red-contrib-simpletime/blob/tickboxes/simpletime.html>

  
[edit]30Jun 9:30 changed to right link [/edit]

---

<div class="post-metadata">

**Author:** ![cinhcet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cinhcet/32/438_2.png) [@cinhcet](https://discourse.nodered.org/u/cinhcet)\
**Post date:** [29 June 2020 22:40 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/31 "2020-06-29T22:40:48Z")

</div>

Try `<button type="button" class="red-ui-button">Button</button>`

Edit: maybe you also find a font-awesome icon for that button

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 June 2020 06:20 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/32 "2020-06-30T06:20:16Z")

</div>

further to what @cinhcet suggested, you can use the browsers Devtools you can inspect a button similar & see what classes are applied. You can even add a class to your buttons directly in the Devtools to see what it looks like before you modify your source.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [30 June 2020 06:38 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/33 "2020-06-30T06:38:45Z")

</div>

And side by side layout would help

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [30 June 2020 07:08 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/34 "2020-06-30T07:08:54Z")

</div>

what about (to give you the flexibility you want and to make it the be and end all) - a single checkbox to include the selected options (so more than one) as msg properties so select mymonth, myday, myhour and it puts these out as msg.mymonth, msg.myday, msg.myhour - then they could just be grabbed in a change node and set however you want it to look on the way out ?

Craig

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 June 2020 08:24 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/35 "2020-06-30T08:24:07Z")

</div>

> [@Steve-Mcl](#):
>
> you can use the browsers Devtools you can inspect a button similar & see what classes are applied. You can even add a class to your buttons directly in the Devtools to see what it looks like before you modify your source.

wooooooshsh.................... 😆

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 June 2020 08:42 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/36 "2020-06-30T08:42:29Z")

</div>

Ta 🙂 Looks much nicer

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/196acf932a3ee0b23a26b371a1d4d157db1949a7.jpeg)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 June 2020 09:54 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/37 "2020-06-30T09:54:55Z")

</div>

> [@cymplecy](#):
>
> wooooooshsh

😆

If you get a taste for development, you will probably end up in devtools at some point.

If you are interested in exploring this, you can right-click a button you like the style of, click "Inspect" from the popup context menu - see what classes & style values are applied to that button then right-click your button -\> inspect, then apply class and style changes (in the browser) to see the effect before you apply the changes to your source code (saves time restarting / refreshing etc)

Welcome to the team 😉

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 June 2020 10:34 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/38 "2020-06-30T10:34:37Z")

</div>

Thanks for the further info - had a play but I think less is better in this case rather than coloured 🙂

@Paul-Reed

I jsut photo-shopped it to stick buttons on the top - which one do you prefer this or previous one with them at the bottom?

Or some other arrangement?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/7/a7a587d74754620247f4b1f6bd6a085a4a431af1.jpeg)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 June 2020 10:38 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/39 "2020-06-30T10:38:03Z")

</div>

I don't know what you mean by this

Paul just wanted an easy method to select/unselect all the boxes so that's why I went for two buttons

Are you talking about a completely different design concept?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 June 2020 10:59 UTC](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069/40 "2020-06-30T10:59:43Z")

</div>

The way I read it is, why not just include or not include the extra values. Is there any real benefit from excluding individual items? I don't imagine there is a huge cost (in terms of CPU cycles) including all of these properties in every message, then the user can chose to (or not) use 1 or more of them. Seems like an awful lot of dev work for reasons I don't know what benefit (disclaimer - I haven't read the entire thread) But feel free to correct me if I am wrong by all means.

Ps If I were to go down the path suggested by @craigcurtin, I would personally wrap all those properties in their own object (e.g. msg.simpletime.hour, msg.simpletime.second, etc ) rather than directly in the msg.

Ps2, this is not a jibe or criticism of your work or direction, only a personal observation and an interpretation of what @craigcurtin said - I mean no offence.

[Previous page](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069.md?page=1)

[Next page](https://discourse.nodered.org/t/node-red-contrib-simpletime-enhancement/29069.md?page=3)
