pub const DEFAULT_DATE_FORMATTER: DateFormatter<'static>;
Expand description

String formatter used by default in DateSelect prompts. Prints the selected date in the format: Month Day, Year.

Examples

use chrono::NaiveDate;
use inquire::formatter::DEFAULT_DATE_FORMATTER;

let formatter = DEFAULT_DATE_FORMATTER;

assert_eq!(
    String::from("July 25, 2021"),
    formatter(NaiveDate::from_ymd(2021, 7, 25)),
);
assert_eq!(
    String::from("January 1, 2021"),
    formatter(NaiveDate::from_ymd(2021, 1, 1)),
);