Skip to content

feedback: datetime_object | Tarantool #3339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TarantoolBot opened this issue Feb 16, 2023 · 2 comments · Fixed by #4413
Closed

feedback: datetime_object | Tarantool #3339

TarantoolBot opened this issue Feb 16, 2023 · 2 comments · Fixed by #4413
Labels
datetime reference [location] Tarantool manual, Reference part

Comments

@TarantoolBot
Copy link
Collaborator

<…>

|datetime_object|

object datetime_object
Since 2.10.0.

datetime_object:totab<…>

https://www.tarantool.io/en/doc/latest/reference/reference_lua/datetime/datetime_object/#datetime-obj

Incomplete documentation. missing .timestamp field, and comparission methods

@andreyaksenov andreyaksenov assigned andreyaksenov and unassigned veod32 Aug 1, 2024
@andreyaksenov andreyaksenov linked a pull request Aug 2, 2024 that will close this issue
@andreyaksenov andreyaksenov removed a link to a pull request Aug 5, 2024
@ligurio
Copy link
Member

ligurio commented Aug 5, 2024

Tarantool version: commit hash 93fb2363cb45dc47a94eb221d5904b8b823e614d

Regarding timestamp field

timestamp field is missed in a table produced by :totable:

tarantool> datetime.new(v):totable()
---
- sec: 0
  min: 0
  yday: 214
  day: 1
  nsec: 0
  isdst: false
  wday: 5
  tzoffset: 0
  month: 8
  year: 2024
  hour: 0
...

tarantool> datetime.new(v).timestamp
---
- 1722470400
...

However, this field is available as a property of datetime object. Before fixing doc this should be fixed (or not) in Tarantool itself (see tarantool/tarantool#10374).

Regarding comparison operators

it is possible to use comparison operators with datetime objects:

tarantool> d1 = datetime.new(v)
---
...

tarantool> d2 = datetime.new(v)
---
...

tarantool> d1 == d2
---
- true
...

tarantool> d1 ~= d2
---
- false
...

tarantool> d1 >= d2
---
- true
...

tarantool> d1 < d2
---
- false
...

tarantool> 

These operators were supported from the beginning (see commit tarantool/tarantool@43e10ed) and documented in scope of issue #2411. However, comparison operators were missed in a doc request. Let's fix this here.

Updated (06.08.2024): add a reference to tarantool/tarantool#10374

@andreyaksenov andreyaksenov removed their assignment Aug 6, 2024
@andreyaksenov andreyaksenov added datetime reference [location] Tarantool manual, Reference part labels Aug 6, 2024
@ligurio
Copy link
Member

ligurio commented Aug 6, 2024

Incomplete documentation. missing .timestamp field, and comparission methods

ligurio added a commit that referenced this issue Aug 6, 2024
Follows up commit de58780
("Add a new section for the datetime module with the description of its main functions and methods").

Datetime comparison has been added in [1] (since 2.10.0-beta2),
interval comparison has been added in commit [2]
(since 2.11.0-rc1).

1. tarantool/tarantool@43e10ed
2. tarantool/tarantool@65a3c17

Follows up #2411
Fixes #3339
ligurio added a commit that referenced this issue Aug 6, 2024
Follows up commit de58780
("Add a new section for the datetime module with the description of its main functions and methods").

Datetime comparison has been added in [1] (since 2.10.0-beta2),
interval comparison has been added in commit [2]
(since 2.11.0-rc1).

1. tarantool/tarantool@43e10ed
2. tarantool/tarantool@65a3c17

Follows up #2411
Fixes #3339
ligurio added a commit that referenced this issue Aug 6, 2024
Follows up commit de58780
("Add a new section for the datetime module with the description of its main functions and methods").

Datetime comparison has been added in [1] (since 2.10.0-beta2),
interval comparison has been added in commit [2]
(since 2.11.0-rc1).

1. tarantool/tarantool@43e10ed
2. tarantool/tarantool@65a3c17

Follows up #2411
Fixes #3339
ligurio added a commit that referenced this issue Aug 6, 2024
Follows up commit de58780
("Add a new section for the datetime module with the description of its main functions and methods").

Datetime comparison has been added in [1] (since 2.10.0-beta2),
interval comparison has been added in commit [2]
(since 2.11.0-rc1).

1. tarantool/tarantool@43e10ed
2. tarantool/tarantool@65a3c17

Follows up #2411
Fixes #3339
andreyaksenov pushed a commit that referenced this issue Aug 7, 2024
Follows up commit de58780
("Add a new section for the datetime module with the description of its main functions and methods").

Datetime comparison has been added in [1] (since 2.10.0-beta2),
interval comparison has been added in commit [2]
(since 2.11.0-rc1).

1. tarantool/tarantool@43e10ed
2. tarantool/tarantool@65a3c17

Follows up #2411
Fixes #3339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datetime reference [location] Tarantool manual, Reference part
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants