Use consistent singular function naming for SQL time functions

This commit is contained in:
Tobie Morgan Hitchcock 2022-11-03 10:50:51 +00:00
parent f3c9a9ab4b
commit 7f953319ec
3 changed files with 6 additions and 6 deletions

View file

@ -184,12 +184,12 @@ pub fn synchronous(ctx: &Context<'_>, name: &str, args: Vec<Value>) -> Result<Va
"time::format" => time::format,
"time::group" => time::group,
"time::hour" => time::hour,
"time::mins" => time::mins,
"time::minute" => time::minute,
"time::month" => time::month,
"time::nano" => time::nano,
"time::now" => time::now,
"time::round" => time::round,
"time::secs" => time::secs,
"time::second" => time::second,
"time::unix" => time::unix,
"time::wday" => time::wday,
"time::week" => time::week,

View file

@ -80,7 +80,7 @@ pub fn hour((datetime,): (Option<Value>,)) -> Result<Value, Error> {
Ok(date.hour().into())
}
pub fn mins((datetime,): (Option<Value>,)) -> Result<Value, Error> {
pub fn minute((datetime,): (Option<Value>,)) -> Result<Value, Error> {
let date = match datetime {
Some(Value::Datetime(v)) => v,
None => Datetime::default(),
@ -127,7 +127,7 @@ pub fn round((datetime, duration): (Value, Value)) -> Result<Value, Error> {
})
}
pub fn secs((datetime,): (Option<Value>,)) -> Result<Value, Error> {
pub fn second((datetime,): (Option<Value>,)) -> Result<Value, Error> {
let date = match datetime {
Some(Value::Datetime(v)) => v,
None => Datetime::default(),

View file

@ -422,12 +422,12 @@ fn function_time(i: &str) -> IResult<&str, &str> {
tag("time::format"),
tag("time::group"),
tag("time::hour"),
tag("time::mins"),
tag("time::minute"),
tag("time::month"),
tag("time::nano"),
tag("time::now"),
tag("time::round"),
tag("time::secs"),
tag("time::second"),
tag("time::unix"),
tag("time::wday"),
tag("time::week"),