Giter VIP home page Giter VIP logo

Comments (4)

azrikahar avatar azrikahar commented on August 28, 2024 1

Just as an update, seems like we might be able to pull off formats like X hours ago without any external dependencies using Intl.RelativeTimeFormat. Safari started supporting it late last year so it should be ok to use: https://caniuse.com/mdn-javascript_builtins_intl_relativetimeformat

Sample output in Devtools just as a quick demo:

image

from examples.

rijkvanzanten avatar rijkvanzanten commented on August 28, 2024

From a tech perspective, I'd personally prefer a date string "3rd of October, 2021" 'cause of the dependency thing you mentioned. @benhaynes ?

from examples.

benhaynes avatar benhaynes commented on August 28, 2024

That works — as simple as possible!

Can we do: October 3 when in this year, and October 3, 2020 when in a previous year? I assume that doesn't need a library. If that's too much overhead, let's just do October 3, 2020 format for all.

from examples.

benhaynes avatar benhaynes commented on August 28, 2024

Oh, nice!! Would love to have more control here!

from examples.

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.