-
Notifications
You must be signed in to change notification settings - Fork 27.4k
"ago" filter #611
Comments
Is there a way to inject locale other than passing an optional value? |
I'm sorry, not sure I understand, what you mean... Currently you can access service from filter through scope.$service('service-to-inject'); However, we are changing that so that you can inject into filters in the same way as into services... |
This might seem like a silly question, but how would the $locale service work in this context? For example, I have the time date string 2011-10-25 21:32:00; I wrote a filter to format that into something friendlier like {{mydate|formatdate:"m/d/Y"}} to return a date like 10/25/2011. How would I use the $locale service within the filter to return a relative time like "3 minutes ago" into "hace 3 minutos"? |
Not promising anything, but I have a nice idea that I'll try to implement this weekend. I think if we're doing "ago" we might also need something like "in future", which is essentially the same thing. |
Is this still something that we're interested in adding to AngularJS core? If so, I can write one sometime. |
google brings up someone claiming to already have written something similar: http://avalanche123.com/blog/2012/02/29/angularjs-superheroic-javascript-mvc-framework/ |
+1. I may hack together a one-off for a prototype we're building but may not be modularized enough for a pull-request. |
I use momentjs: it has a |
Does it tie into angular data? On Mon, Feb 18, 2013 at 3:53 PM, Greg Weber [email protected]:
|
I just call it from the view so it stays up to date: something more efficient could be made. |
An alternative was discussed some months ago. You could also have a look into this: https://groups.google.com/forum/#!topic/angular/o7vl4tsg53w There is a mention to momentjs at the end of the thread, although I haven't checked it yet. |
I could definitely use this, +1 from me! |
this should probably be a separate Bower module On Mon, Jun 10, 2013 at 6:33 AM, Elger Lambert [email protected]:
|
Agree with @btford |
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months. Please try the newest versions of Angular ( Thanks! |
Would be nice to have a filter to display timestamps in more "human" way, relatively to current time. Something like:
x seconds ago, a hours ago, etc...
Note, that the messages need to be localizable.
The text was updated successfully, but these errors were encountered: