bitwalker / bitwalker/timex

Inconsistency in `shift/2` with months, years

Open
#739 2 comments 2 reactions 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

```elixir
> start_datetime = ~U[2024-02-29 09:00:00Z]
~U[2025-02-28 09:00:00Z]

> Timex.shift(start_datetime , months: 12)
~U[2025-03-01 09:00:00Z]

> Timex.shift(start_datetime , months: 12) == Timex.shift(start_datetime , years: 1)
false
```

### Description of issue

- What are the expected results?

The results of shifting 12 months and 1 year are the same.

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.