mxtommy / Kip

SignalK Instrument package
MIT License
80 stars 43 forks source link

Feature Request: Date formatting #172

Closed JonyIvy closed 1 year ago

JonyIvy commented 1 year ago

Kip is such a great app already, thank you very much!

Today I created a page with sun and moon rise/set times. The data comes from signalk-derived-data and is an ISO string (eg. 2023-03-07T09:49:00.000Z). It would be nice to have a DateTime formatter that can transform this string to just hour and minute and that in local time. Maybe something like this would work in units.service.ts:

"DateTime time": function(v) {
      const d = new Date(v);
      return d.getHours() + ':' + d.getMinutes();
    },

or

"DateTime time": function(v) {
      const d = new Date(v);
      return d.toTimeString();
    },
slurcott commented 1 year ago

this can be done in NodeRed

JonyIvy commented 1 year ago

I've seen there is a PR for this (https://github.com/mxtommy/Kip/pull/148). It would do what I need, if in a bit different way. What's the status on this PR?

godind commented 1 year ago

@JonyIvy this will be part of V2 release. Soon...!