Coder Social home page Coder Social logo

Comments (10)

olivergg avatar olivergg commented on July 23, 2024 1

Done #46

from skooner.

kvpt avatar kvpt commented on July 23, 2024

Also the age seems wrong to me.
image
image

If you need more informations to reproduce the issue, let me know.

from skooner.

herbrandson avatar herbrandson commented on July 23, 2024

Hey @kvpt. I'm using an npm package for converting the date into "age" and unfortunately the letter "m" for both minutes and months :(

Does that explain what you're seeing?

from skooner.

kvpt avatar kvpt commented on July 23, 2024

Oh yes you're right, the second screenshot show that.

from skooner.

olivergg avatar olivergg commented on July 23, 2024

@herbrandson this library has not been updated for years now. I kinda guess you've switched from Moment.js to it for performance reason. Would you like to have a PR with another lib in k8dash or a PR in the time-ago project to merely fix the specific use case (milliseconds vs minutes vs month, all represented by 'm') ?
Btw, thanks for this amazing project k8dash ;)

from skooner.

herbrandson avatar herbrandson commented on July 23, 2024

I suspect the easiest route would be a pr in k8dash (which I would love!). Is there a specific library you're considering?

from skooner.

olivergg avatar olivergg commented on July 23, 2024

@herbrandson what about humanize-duration ?

var humanizeDuration = require("humanize-duration")

const shortEnglishHumanizer = humanizeDuration.humanizer({
  language: 'shortEn',
  languages: {
    shortEn: {
      y: () => 'y',
      mo: () => 'mo',
      w: () => 'w',
      d: () => 'd',
      h: () => 'h',
      m: () => 'm',
      s: () => 's',
      ms: () => 'ms',
    }
  }
})
var nd = 1554401268000; // 4/4/2019
var diff = Date.now() - new Date(nd).getTime()
shortEnglishHumanizer(diff).split(",")[0]
// => "8 mo"

from skooner.

herbrandson avatar herbrandson commented on July 23, 2024

LGTM. Do you want to create a PR?

from skooner.

olivergg avatar olivergg commented on July 23, 2024

@herbrandson Yes, I'll try to do that this week :-)

from skooner.

herbrandson avatar herbrandson commented on July 23, 2024

Thanks for the PR! It's been merged and this should now be resolved :)

from skooner.

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.