Fix bug in time::month() (#215)

This commit is contained in:
Sven Taute 2022-09-19 03:35:54 +02:00 committed by GitHub
parent 340af01227
commit 94dc566d3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,9 +89,9 @@ pub fn mins(_: &Context, mut args: Vec<Value>) -> Result<Value, Error> {
pub fn month(_: &Context, mut args: Vec<Value>) -> Result<Value, Error> { pub fn month(_: &Context, mut args: Vec<Value>) -> Result<Value, Error> {
match args.len() { match args.len() {
0 => Ok(Utc::now().day().into()), 0 => Ok(Utc::now().month().into()),
_ => match args.remove(0) { _ => match args.remove(0) {
Value::Datetime(v) => Ok(v.day().into()), Value::Datetime(v) => Ok(v.month().into()),
_ => Ok(Value::None), _ => Ok(Value::None),
}, },
} }