datetime: forbid non-integers in :set() and parse()
The patch forbids using non-integer values in datetime's `:set()` for `year`, `month`, `day`, `hour`, `min`, `sec`, `usec`, `msec` and `nsec` keys. The type of `tzoffset` can be integer or string, `timestamp` can be double, and integer values allowed in timestamp if `nsec`, `usec`, or `msecs` provided. An error will be raised when a value of incorrect type is passed. Part of #10391 @TarantoolBot document Title: Update types of values passed to `:set()` and parse() `:set()` can accept only integer values for `year`, `month`, `day`, `hour`, `min`, `sec`, `usec`, `msec` and `nsec`. The type of `tzoffset` can be integer or string, `timestamp` can be integer or double. `tzoffset` passed to `datetime.parse()` can be integer or string. (cherry picked from commit 6e77907baa3cbeebc79241cc0046a539a09e3f2c)
Showing
- changelogs/unreleased/gh-10391-forbid-non-integers-datetime-set.md 3 additions, 0 deletions...s/unreleased/gh-10391-forbid-non-integers-datetime-set.md
- src/lua/datetime.lua 9 additions, 0 deletionssrc/lua/datetime.lua
- test/app-tap/datetime.test.lua 23 additions, 2 deletionstest/app-tap/datetime.test.lua
Loading
Please register or sign in to comment