Skip to content
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

Notice alert display wrong time #1262

Closed
proyb2 opened this issue Apr 19, 2012 · 8 comments
Closed

Notice alert display wrong time #1262

proyb2 opened this issue Apr 19, 2012 · 8 comments
Assignees
Milestone

Comments

@proyb2
Copy link

proyb2 commented Apr 19, 2012

I have created a new datasource and the green notice message at the top showing "created 6 hours ago" instead of "a few milliseconds ago"?

Based on:
http://symphony-cms.com/discuss/thread/86867/#position-5

Screenshot:
http://postimage.org/image/vfsq53pwl/

Details:
2.3RC1 (Integration)

Installation Timezone set to Singapore

Google Chrome
No error in manifest log
This is reproducible on Sections, Page, etc as well. Could it be related to timezone?

@nilshoerrmann
Copy link
Contributor

Symphony compares the time returned by your server with the time in your browser. Please check if both sides are set up correctly.

@proyb2
Copy link
Author

proyb2 commented Apr 19, 2012

Tested on local PC is indeed 6 hours earler than my Windows system time.

Will there be any issue if the user is located in other timezone where my server is 8am and user is 2am?

@nilshoerrmann
Copy link
Contributor

Hm, there shouldn't be any problems: we compare timestamps and those always refer to GMT as far as I know.

@kanduvisla
Copy link
Contributor

Could be the same issue, since my timezone setting is GMT +0200, but earlier versions of Symphony always showed this right. Is the time showed perhaps calculated with JavaScript, and therefore comparing the local system time with the remote server time?

@brendo brendo reopened this May 10, 2012
@brendo
Copy link
Member

brendo commented May 10, 2012

The handling of time ago has changed, and I tend to agree that's it's a bit of regression.

In 2.2.5, the date in the message was parsed via in Javascript with Date.parse() to return the UNIX timestamp. Two new 'date' objects were created, new Date(), and then one was passed the timestamp with .setTime. This meant that the time suddenly became the same as your computer clock.

I think this is the correct behaviour, while comparing from the server time to the browser time seems 'right', it doesn't really make sense, because the entry was not saved 2 hours ago, but it was saved just then, by you.

@brendo brendo closed this as completed in 167d8c5 May 13, 2012
@brendo brendo reopened this May 24, 2012
@brendo
Copy link
Member

brendo commented May 24, 2012

This fails on -GMT timezones, such America/Kentucky/Louisville. Reports here and here

@ghost ghost assigned brendo May 24, 2012
@nilshoerrmann
Copy link
Contributor

What about adding an additional data-timestamp attribute to Widget::time(). This way, the JavaScript won't have to convert the given date to a timestamp first (at least I guess this is where the error occurs).

@brendo
Copy link
Member

brendo commented May 26, 2012

That sounds like a good solution

@brendo brendo closed this as completed in 2e1d29c May 27, 2012
brendo added a commit that referenced this issue May 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants