New issue 452 by vaibhr...@gmail.com: I dont want time in Bubble popups date
http://code.google.com/p/simile-widgets/issues/detail?id=452
What steps will reproduce the problem?
1.click on any event, bubble popup will open
2.see date format
3.
What is the expected output? What do you see instead?
I just want "Sat Jan 4 2011" instead of "Sat Jan 4 18:30:00 UTC+0530 2011"
What version of the product are you using? On what browser and what
operating system?
I am using IE8 with Windows OS
Please provide any additional information below.
I need to change date time format on bubble popup
Same applies to me. I'd like to produce German sort of date, like "So,
1.1.2012 15:00 Uhr" instead of "Sun Jan 1 2012...". Any idea? Thanks a lot.
I poked around in the source code and found the function that is
responsible for outputting the date.
Timeline.GregorianDateLabeller.prototype.labelPrecise = function(date) {
return SimileAjax.DateTime.removeTimeZoneOffset(
date,
this._timeZone //+ (new Date().getTimezoneOffset() / 60)
).toUTCString();
};
Notice the .toUTCString()
To change the date format you'll have to override this function in your
code after you have loaded timeline-api.js and before initialising your
timeline.
for example to display only the date (in long format):
Timeline.GregorianDateLabeller.prototype.labelPrecise = function (date)
{
return SimileAjax.DateTime.removeTimeZoneOffset(
date,
this._timeZone //+ (new Date().getTimezoneOffset() / 60)
).toLocaleDateString();
};
I don't know the importance of the removeTimeZoneOffset-function, so I just
left it alone. Have a look at
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date
for all functions regarding to the Date-object.