-
-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a CSS Class or Style Color to Past DateTime #223
Comments
I don't think I have a good answer here. There's no direct support for this right now, but it's something I would consider. Perhaps a I'd be willing to accept a clean PR to add this feature. |
+1 |
Here's a Gist of Timeago with colors for tense. You can change the default blue and red to either a color name of hex value from the inPastColor variable. |
Thanks, but the Gist does not play nicely with internationalization or custom strings. We need something with deeper integration. |
Hi @chaimleib, I've rewritten the Gist for this so it works better for internationalisation. Let me know your thoughts on the update. |
@jakerb does this replace the timeagojs or do we need just to add it as source after timeagojs? |
In my app that is using this TimeAgo library I would like to style the text with a different color using CSS when the DateTime text is past the current DateTime of today.
So if it says 4 days from now it will be regular just how it is normally.
However if it is in the past like 4 days ago then I could have the text be in a different color like red.
Looking in Chrome Dev tools, it does not appear to add any special CSS class or styles to the time element in which would let me target a past date string.
Does anyone know of a simple way, or anyway really that I could change the text color if the date is in the past?
I saw another post on StackOverflow with the same question buit no answers so far here http://stackoverflow.com/questions/30410273/jquery-timeago-library-to-change-color-of-text-if-the-datetime-is-in-the-past
Any ideas or help?
The text was updated successfully, but these errors were encountered: