Git Product home page Git Product logo

Comments (8)

iamkun avatar iamkun commented on June 13, 2024 1

Maybe it will be better to be implemented via a plugin.
IMHO, this might be a project logic, not a common one in dayjs?

from dayjs.

willismonroe avatar willismonroe commented on June 13, 2024

I know this is potentially not easy given the Julian/Gregorian change, but it would be very useful!

from dayjs.

klm-turing avatar klm-turing commented on June 13, 2024

HI @willismonroe ,
I went through your issue and here's what I've come up with so far

dayjs('-2006').toDate() ==> Wed Jan 01 -2600 00:00:00 GMT-0016 (Greenwich Mean Time).

Is this enough for you? Do you have any other use cases you'd like to test?

from dayjs.

willismonroe avatar willismonroe commented on June 13, 2024

I just tried this on a REPL and got the same result as earlier:
image

This is version 1.11.10 btw

from dayjs.

willismonroe avatar willismonroe commented on June 13, 2024

Sorry @klm-turing were you showing the output of a proposed fix? If so, that's great. No other issues I'd like to test at the moment, as I mentioned earlier there are quite a few edge cases extra that would be worth looking into, but even just having negative years is a huge improvement.

from dayjs.

klm-turing avatar klm-turing commented on June 13, 2024

@willismonroe I wanted to know if it was enough for you first.

I linked a PR 2640. Test it and let me know

Screenshot from 2024-04-26 16-49-29

from dayjs.

klm-turing avatar klm-turing commented on June 13, 2024

@iamkun nice touch, I will do that

from dayjs.

klm-turing avatar klm-turing commented on June 13, 2024

@iamkun The plugin is done, If you have time, Please have a look.

from dayjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.