Skip to content

Commit cd33d00

Browse files
YYYY date format parsed to YYYY-01-01
1 parent b74e1f8 commit cd33d00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

encoding/src/decode/primitive_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn parse_date(buf: &[u8]) -> Result<(NaiveDate, &[u8])> {
1111
0 | 5 | 7 => Err(InvalidValueReadError::UnexpectedEndOfElement.into()),
1212
1..=4 => {
1313
let year = read_number(buf)?;
14-
let date: Result<_> = NaiveDate::from_ymd_opt(year, 0, 0)
14+
let date: Result<_> = NaiveDate::from_ymd_opt(year, 1, 1)
1515
.ok_or_else(|| InvalidValueReadError::DateTimeZone.into());
1616
Ok((date?, &[]))
1717
}

0 commit comments

Comments
 (0)