bitwalker / bitwalker/timex

Calling `Interval.new` on `DateTime`s, changes the interval to use `NaiveDateTime`

Open
#707 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Elixir
Stars
1.8k
Forks
407
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce
The following code snippet:
```elixir
from = ~U[2021-01-07 00:00:00.000000Z]
until = ~U[2021-03-07 00:00:00.000000Z]

Timex.Interval.new(from: from, until: until)
```

returns:
```elixir
%Timex.Interval{
from: ~N[2021-01-07 00:00:00.000000],
left_open: false,
right_open: true,
step: [days: 1],
until: ~N[2021-03-07 00:00:00.000000]
}
```

### Description of issue

I would expect the result to keep the same type as the input ones, and not implicitly convert them to `NaiveDateTime`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.