Skip to content

Commit 79ddb27

Browse files
committed
lua, datetime: time intervals support
* created few entry points (months(N), years(N), days(N), etc.) for easier datetime arithmetic; * additions/subtractions of years/months use `dt_add_years()` and `dt_add_months()` from 3rd party c-dt library; * also there are `:add{}` and `:sub{}` methods in datetime object to add or substract more complex intervals; * introduced `is_datetime()` and `is_interval()` helpers for checking of validity of passed arguments; * human-readable stringization implemented for interval objects. Note, that additions/subtractions completed for all _reasonable_ combinations of values of date and interval types; Time + Interval => Time Interval + Time => Time Time - Time => Interval Time - Interval => Time Interval + Interval => Interval Interval - Interval => Interval Part of tarantool#5941
1 parent 84f652a commit 79ddb27

File tree

3 files changed

+655
-96
lines changed

3 files changed

+655
-96
lines changed

src/exports.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ EXPORT(uuid_nil)
535535
EXPORT(uuid_unpack)
536536
EXPORT(datetime_unpack)
537537
EXPORT(datetime_pack)
538+
EXPORT(dt_add_months)
539+
EXPORT(dt_add_years)
540+
EXPORT(dt_add_quarters)
538541
EXPORT(dt_from_rdn)
539542
EXPORT(dt_from_yd)
540543
EXPORT(dt_from_ymd)

0 commit comments

Comments
 (0)