question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Support dates with negative years (i.e. BCE)

See original GitHub issue

I have tried to create DateTime objects in BCE, for example like this DateTime.parseISO('-7000-0-0') or DateTime.fromFormat('-7000', 'yyyyy'). However, they all have NaN` as year.

How can I create such dates?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dasacommented, Apr 28, 2022

Try: luxon.DateTime.fromObject({year:-1234, month:9, day:25}).toLocaleString({ ...luxon.DateTime.DATE_FULL, era: "short" }) -> “September 24, 1235 BC”

See “era” options at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat

0reactions
59023gcommented, Apr 28, 2022

I don’t see a way to include year notation, ie BCE, AD when I invoke toLocaleString(). Does this exist?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Negative Dates (i.e. years BCE/BC) - AcrobatFAQ.com
Negative integers from -1 to -2500, when coerced to dates, are interpreted as years BCE (or BC). This is particularly useful for timeline...
Read more >
Storing Negative-Dates to Represent BC/BCE (vs AD/CE) in ...
How precise does your storage need to be? Is it years, days, or hours/minutes. If you are only looking at Days or Years,...
Read more >
Date - JavaScript - MDN Web Docs - Mozilla
Chrome Edge Date Full support. Chrome1. Toggle history Full support. Edge12. Toggle hist... @@toPrimitive Full support. Chrome47. Toggle history Full support. Edge15. Toggle hist... Date() constructor...
Read more >
Feature request response email templates - LiveAgent
Receiving feature requests should not be viewed as negative feedback. In fact, it means that your customers care enough to share their ideas...
Read more >
Sales Tax API Reference - TaxJar Developers
If you have any questions or would like to request support for a new ... TaxJar has introduced API versioning to deliver enhanced...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found