Comments (6)
Hi @jeevasusej,
As mentioned, you need to make sure the plugin receives a TZ aware timestamp.
So instead of passing
from-time="2016-06-02T10:20:28.130509"
I passed:
from-time="2016-06-02T10:20:28.130509+02:00"
This way angular-timeago know in that TZ the timestamp is and can correctly show it in browsers/users TZ.
Hope that makes sense.
from angular-timeago.
Can you provide us a code example with the problem and what you are expecting ?
I don't understand your request right now =/
from angular-timeago.
Hi astik,
Of course, sorry for being too vague.
<time-ago class="datetime" from-time="{{m.datetime}}" format='MM/dd/yyyy'></time-ago>
m.datetime is a string in ISO format: %Y-%m-%dT%H:%M:%S
Now let's say timestamp it's 1pm UTC, the server will render 2016-06-01T13:00:00 as m.datetime
And currently is 2pm UTC (so one hour later), I would expect the time-ago to output "one hour ago".
However, my browser being on CEST, the time-ago actually outputs "3 hours ago". Seems like it assumes that the m.datetime timestamp is in my local TZ.
Patrik
from angular-timeago.
I solved it by rendering TZ into the string on server:
datetime: '2016-06-02T10:20:28.130509+02:00'
We can close this, thanks for your time
from angular-timeago.
No problem, glad you find your way out =)
from angular-timeago.
@patrik7, How did you solve? Can you paste the code?
from angular-timeago.
Related Issues (20)
- Basic directive does not update when 'from-time' value updates HOT 1
- Use $interval instead of $timeout
- Easier way to add new languages HOT 3
- Basic Filter timeAgo not updating HOT 1
- Assign class to timeAgo directive base on value being a past or future value. HOT 1
- Publish last changes to bower and npm HOT 1
- Project building for version 0.4.2 HOT 2
- Specific time ago with breakpoints?
- Add support for moment objects
- Timezone support HOT 2
- Failed to instantiate HOT 4
- Error: Invalid Date toISOString@[native code] HOT 2
- custom formats
- Suppress output when date is null, instead of "NaN years ago" HOT 1
- Disable timeago when printing
- Update the dist folder HOT 2
- Do I need both JS files from the dist folder? HOT 1
- Issue With displaying 23 hours and converting to Date Format
- Timeago setting in Angular 2.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-timeago.