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