pub struct DateFormatter { /* private fields */ }Implementations§
Source§impl DateFormatter
impl DateFormatter
pub fn new(format_str: &str) -> Self
Sourcepub fn format_datetime(&self, dt: &NaiveDateTime) -> String
pub fn format_datetime(&self, dt: &NaiveDateTime) -> String
Format a chrono NaiveDateTime.
Sourcepub fn format_date_str(&self, date_str: &str) -> Option<String>
pub fn format_date_str(&self, date_str: &str) -> Option<String>
Format a date string (parse then format). Accepts ISO date strings like “2024-01-15” or “2024-01-15T10:30:00”.
Trait Implementations§
Source§impl Clone for DateFormatter
impl Clone for DateFormatter
Source§fn clone(&self) -> DateFormatter
fn clone(&self) -> DateFormatter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DateFormatter
impl RefUnwindSafe for DateFormatter
impl Send for DateFormatter
impl Sync for DateFormatter
impl Unpin for DateFormatter
impl UnsafeUnpin for DateFormatter
impl UnwindSafe for DateFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more