# Local-dates: dates show days in the future

**URL:** <https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408>\
**Category:** Bug\
**Created:** [June 3, 2019, 6:47pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408 "2019-06-03T18:47:02Z")\
**Posts on this page:** 8\
**Page:** 1

## AI-generated summary

The discussion is about an issue with Local-dates, where dates show days in the future. [supermathie](/t/-/119408/1) reported the issue and provided an example of the problem, where the timezones displayed are not the ones specified in the `timezones` attribute. [zogstrip](/t/-/119408/4) confirmed the issue and found the problem to be a mutation of the same `dateTime` object when generating previews, causing a discrepancy. This issue has been fixed in a commit to the Discourse repository ([https://github.com/discourse/discourse/commit/c131903e56227ce76f649cc24d327f640ae843e7](https://github.com/discourse/discourse/commit/c131903e56227ce76f649cc24d327f640ae843e7)).

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [June 3, 2019, 6:47pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/1 "2019-06-03T18:47:02Z")

</div>

For example:

```plaintext
[date=2019-06-05 timezone="America/Toronto" timezones="Africa/Cairo|America/Toronto|UTC"]

```

2019-06-05T04:00:00Z

shows up in preview and baked for me as:

> ![image](https://global.discourse-cdn.com/meta/original/3X/3/3/3343b376f177de7665e7f5cbf0f94fe1cba40e30.png)

UTC is not 52h in the future for me 😃 (it’s 4h ahead)

---

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [June 3, 2019, 9:46pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/3 "2019-06-03T21:46:47Z")

</div>

I know @zogstrip was hunting for a bug of this kind the other day, will assign him for now.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [June 3, 2019, 9:57pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/4 "2019-06-03T21:57:55Z")

</div>

Ok, I’m not crazy 🤪

* * *

Leaving a note for future me, here’s what I see now

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/b/8bca924b0ed8783b7ddb003cb2d11adaab7f7f03.png)

The timezones are all wrong here… Paris, Paris, UTC 🤔

---

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [June 3, 2019, 10:31pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/6 "2019-06-03T22:31:03Z")

</div>

> [@zogstrip](#):
>
> Paris, Paris

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/2/729cb69a38e3913043f359d7edc1e31061fb3bab.jpeg)

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [June 3, 2019, 10:32pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/7 "2019-06-03T22:32:20Z")

</div>

Yeah, but it should show the ones in the `timezones` attribute… Not some apparently _random_ ones 😮

---

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [June 3, 2019, 10:36pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/8 "2019-06-03T22:36:28Z")

</div>

you know me - love my images

Also, yes, Paris and Paris aren’t 24h apart… 😃

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [June 6, 2019, 9:20am UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/9 "2019-06-06T09:20:33Z")

</div>

Pretty sure I fixed that in

[https://github.com/discourse/discourse/commit/c131903e56227ce76f649cc24d327f640ae843e7](https://github.com/discourse/discourse/commit/c131903e56227ce76f649cc24d327f640ae843e7)

We were mutating the same dateTime object when generating the previews (ie. the date ranges in the tooltip), thus creating a discrepancy in the space time continuum 💥 .

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [June 6, 2019, 4:00pm UTC](https://meta.discourse.org/t/local-dates-dates-show-days-in-the-future/119408/10 "2019-06-06T16:00:02Z")

</div>

Closed on June 6, 2019, 4:00pm UTC

This topic was automatically closed after 6 hours. New replies are no longer allowed.
