Writes a [`Date`] to `buf`.
(buf: &mut F, d: Date)
| 415 | |
| 416 | /// Writes a [`Date`] to `buf`. |
| 417 | pub fn format_date<F>(buf: &mut F, d: Date) -> Nestable |
| 418 | where |
| 419 | F: FormatBuffer, |
| 420 | { |
| 421 | let d: NaiveDate = d.into(); |
| 422 | let (year_ad, year) = d.year_ce(); |
| 423 | write!(buf, "{:04}-{}", year, d.format("%m-%d")); |
| 424 | if !year_ad { |
| 425 | write!(buf, " BC"); |
| 426 | } |
| 427 | Nestable::Yes |
| 428 | } |
| 429 | |
| 430 | /// Parses a `NaiveTime` from `s`, using the following grammar. |
| 431 | /// |
no outgoing calls