Astro2 default Format?

When i look at the various channels and Date/Times in the BasicUI, all of the Astro2 items show with a format of:

YYYY-MM-DD HH:MM And the Hour is in 24hr format.

Is possible to change this default format? I did change the format within the NTP binding, but that did not seem to make a difference.

Is there an option in the Astro2 binding to set the default format?

You can change that in your items label definition:

DateTime Sunrise_Time "Sonnenaufgang [%1$tH:%1$tM]" ...

Text item=Sunrise_Time in your sitemap will show in this case:

For other definitions look for “java date time definitions” in your favorite search engine.

@sihui

Yes, I figured you can change the format with an items file and custom format. But that would also require defining an custom item for each and every existing astro item with a custom date and time format.

I was just hoping maybe you could set a default for all items in the binding so the default paperui date time could be changed.

I’m almost certain that’s not possible. However it’s okay I guess because sunset will be a time, next full moon maybe a date and the next solar eclipse will consist of a year. It doesn’t hurt to define it.

Maybe this will help:

1 Like

You only have to define it for the Channels you are actually using AND want to display on your sitemap. For most practical purposes that will only be a few.

I’m intrigued by a user configurable default for all DateTime Items. Most users will want to display the majority of their DateTimes in the same way (though @ThomDietrich appears to have gone all out :slight_smile: ). I’m not sure how feasible that is in the current sitemap architecture.

What is? Back when I build my astro items file, this took me 10 minutes tops. It’s just a bit of copy&paste really. Have it once, forget about it. What you do in rules or sitemaps is unrelated from that point on forward.

How did you get the “emotes” in to your map?!

Could you define “get”? :slight_smile: You just copy them in there.

What I meant was I don’t know how feasible the current sitemap architecture can support something like setting a default date time format. I agree it really isn’t a significant about of work to copy paste the labels.

When i copy your “Code” in to sublime all emotes are gone :smiley: that’s why i asked^^

Create a new file inside sublime and try again :wink:
The file you are trying to write to is probably not in Unicode but ASCII encoding. ASCII doesn’t know emojis.
You can change that by opening your old file and selecting “File -> Save with Encoding” inside sublime.

1 Like

Quick question after setup the 2 things moon and sun and create the the astro.sitemap astro.items and astro.map

Do I have to set up something more? :smiley: cause i did not get your example to work o.O

I also changed the channel from your “home” to my right local one :smiley:
{ channel="astro:sun:local:set#start" }

In the spirit of the Tutorials and Examples category I have just posted the above example to it’s own thread. Astro Items+Sitemap+Map+♈ Binding Example

It was not really ready to be presented to others but hey, whatever.

What does not work? The simple elements like the sunset/sunrise should be visible right away…

1 Like