Git Product home page Git Product logo

Comments (6)

jasonmit avatar jasonmit commented on June 16, 2024

I agree. I believe it's not rerendering since the underlying value is typically a constant, some moment in time. Perhaps we add some loop to force the rerender?

from ember-moment.

jmurphyau avatar jmurphyau commented on June 16, 2024

It makes sense that the value is not updating - I wouldn't expect it to. I only opened this as an 'issue' since it seems the most appropriate place (maybe a PR instead?)

I've started work and have some logic to work out when the value of the {{ago}} helper will change - see https://github.com/jmurphyau/ember-moment/tree/update-as-time-passes.

Using this would help with working out which value should be used in setting Ember.run.later to trigger rerender.. How would you trigger a rerender though? With HTMLBars I call a 'notify' on the stream but this only covers HTMLBars - if theres a 'rerender' type function/trigger that applies across both Handlebars and HTMLBars that might be the way to go.

from ember-moment.

jasonmit avatar jasonmit commented on June 16, 2024

@jmurphyau I'd be fine if this "rerendering" functionality was only supported on HTMLBars.

from ember-moment.

lukemelia avatar lukemelia commented on June 16, 2024

I would prefer that this be opt-in behavior, or at least have the ability to be opt-out. I can imagine updating automatically updating timestamps being too distracting in many UIs.

from ember-moment.

runspired avatar runspired commented on June 16, 2024

I'm just peeking around on this addon (I have my own moment helpers but wondering what new is out there), the clock or tick pattern is what I use, and I differentiate between live and non-live by exposing duplicate helpers named moment-foo and live-moment-foo

from ember-moment.

jasonmit avatar jasonmit commented on June 16, 2024

I was planning to make it driven by an argument interval. interval 0 by default meaning it will never recalculate. This is also even easier with the new Ember.Helper which has the ability to recompute to trigger a rerender. But I am also not against having separate helpers live vs non-live.

from ember-moment.

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.