chrono icon indicating copy to clipboard operation
chrono copied to clipboard

weekday full name

Open FrederickFrance opened this issue 3 years ago • 1 comments
trafficstars

[changelog]: my_weekday.full_name() display the complete name of the day-of-week (example: "Monday")

FrederickFrance avatar Nov 30 '21 09:11 FrederickFrance

Hi @FrederickFrance - apologies for the long delay here. This looks like a useful function, however it would be great if we can reuse the formatting infrastructure from https://github.com/chronotope/chrono/tree/main/src/format . Potentially these functions could be moved to that module, to sit alongside the FromStr impl for Weekday.

Then the function could then be implemented with format_item passing an Item::Fixed(Fixed::LongWeekdayName). The disadvantage here is that the function would allocate and return a String, but the advantage is that it opens up the possibility of passing or detecting a locale in a subsequent addition. Let me know your thoughts and if this would suit your use case?

esheppa avatar Jun 20 '22 12:06 esheppa

Closing due to inactivity.

pitdicker avatar Jul 19 '23 13:07 pitdicker