Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature][expressions] New expression function "make_interval"
Allows direct construction of interval values from years/months/weeks/ days/hours/minutes/second values, without having to construct a string representation of the interval first
- Loading branch information
1 parent
ca64c6c
commit da042bb
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "make_interval", | ||
"type": "function", | ||
"description": "Creates an interval value from year, month, weeks, days, hours, minute and seconds values.", | ||
"arguments": [ | ||
{"arg":"years","description":"Number of years (assumes a 365.25 day year length).", "optional": true, "default": "0"}, | ||
{"arg":"months","description":"Number of months (assumes a 30 day month length)", "optional": true, "default": "0"}, | ||
{"arg":"weeks","description":"Number of weeks", "optional": true, "default": "0"}, | ||
{"arg":"days","description":"Number of days", "optional": true, "default": "0"}, | ||
{"arg":"hours","description":"Number of hours", "optional": true, "default": "0"}, | ||
{"arg":"minutes","description":"Number of minutes", "optional": true, "default": "0"}, | ||
{"arg":"seconds","description":"Number of seconds", "optional": true, "default": "0"} | ||
], | ||
"examples": [ | ||
{ "expression":"make_interval(hours:=3)", "returns":"3 hour interval"}, | ||
{ "expression":"make_interval(days:=2, hours:=3)", "returns":"2 day, 3 hour interval"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters