Issue 452 in simile-widgets: I dont want time in Bubble popups date

29 views
Skip to first unread message

codesite...@google.com

unread,
Oct 3, 2011, 2:17:03 AM10/3/11
to simile-wi...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

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


codesite...@google.com

unread,
Dec 7, 2011, 2:06:30 AM12/7/11
to simile-wi...@googlegroups.com

Comment #1 on issue 452 by harald.r...@gmail.com: I dont want time in

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.

codesite...@google.com

unread,
Dec 12, 2011, 2:47:13 PM12/12/11
to simile-wi...@googlegroups.com

Comment #2 on issue 452 by flot...@gmail.com: I dont want time in Bubble
popups date
http://code.google.com/p/simile-widgets/issues/detail?id=452

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.

codesite...@google.com

unread,
Aug 8, 2014, 5:23:54 PM8/8/14
to simile-wi...@googlegroups.com

Comment #3 on issue 452 by David.C....@gmail.com: I dont want time in
<!-- monkey patch timeline use of toUTCScring -->
<script>
Timeline.GregorianDateLabeller.prototype.labelPrecise = function(date) {
var tdate = SimileAjax.DateTime.removeTimeZoneOffset(
date,
this._timeZone
) //.toUTCString().replace(/GMT/, '');

var x = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
var day = x[tdate.getDay()];
var date = tdate.getDate();
var y = new
Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var month = y[tdate.getMonth()];
var year = tdate.getFullYear();
var hours = tdate.getHours();
var minutes = tdate.getMinutes();
var seconds = tdate.getSeconds();
var millisecs = tdate.getMilliseconds();

t = day + ", " + date + " " + month + " " + year + " " + hours
+ ":" + minutes + ":" + seconds + "." + millisecs;
return t;
}
</script>


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

codesite...@google.com

unread,
Aug 8, 2014, 5:56:11 PM8/8/14
to simile-wi...@googlegroups.com

Comment #4 on issue 452 by David.C....@gmail.com: I dont want time in
Bubble popups date
http://code.google.com/p/simile-widgets/issues/detail?id=452

<!-- monkey patch timeline use of toUTCScring -->
<script>
Timeline.GregorianDateLabeller.prototype.labelPrecise = function(tdate)
{
//var tdate = SimileAjax.DateTime.removeTimeZoneOffset(
// date,
// this._timeZone
// ) //.toUTCString().replace(/GMT/, '');

var x = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
var day = x[tdate.getDay()];
var date = tdate.getDate();
var y = new
Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var month = y[tdate.getMonth()];
var year = tdate.getFullYear();
var hours = tdate.getHours();
var minutes = tdate.getMinutes();
minutes = ( minutes < 10 ? "0" : "" ) + minutes;
var seconds = tdate.getSeconds();
seconds = ( seconds < 10 ? "0" : "" ) + seconds;
var millisecs = tdate.getMilliseconds();
millisecs = ( millisecs < 100 ? "0" : "" ) + millisecs;
millisecs = ( millisecs < 10 ? "0" : "" ) + millisecs;

dateStr = day + ", " + date + " " + month + " " + year + " " +
hours + ":" + minutes + ":" + seconds + "." + millisecs;
return dateStr;
Reply all
Reply to author
Forward
0 new messages