I'm a rust newbie, and an amateur programmer, and stuck on how to do localized date and date-time formatting for a project I'm working on.
I have a model that includes date formatting configuration that I borrowed from the JS Intl.DateTimeFormat.
I'm using the edtf crate for the parsing, which supports standard ISO dates and date-times, and also extended features like intervals.
In Rust, I have a function that reads the config options, and transforms them into a format spec string.
So, for example, if the output locale is "es", I am aiming to correctly format the month and day in that language; not just the right word, but also grammatical context (sequencing and such):
4 de Abril
For now, I just want to get basic dates working as above, where my date formatting function just has this placeholder:
let formatted_date: String = match edtf_date {
// TODO need localized date rendering, using format_string
Edtf::Date(date) => date.to_string(),
If, as I assume, I need to use Chrono
here, what would be an example usage for this case?
Or is this not even possible?