Problem changing slider format using cartoDB

المشرف العام

Administrator
طاقم الإدارة
I'm new working with cartoDB and I'm trying to show the hour and the date in a torque slider but doesn't work properly and show mm/dd/yyyy instead of mm-dd hh:mm.

Using:

"http://libs.cartocdn.com/cartodb.js/v3/3.14/cartodb.js" script "http://libs.cartocdn.com/cartodb.js/v3/3.14/themes/css/cartodb.css" stylesheet

I'm using the following code:

function main() { cartodb.createVis('map', 'viz.json', { shareable: true, title: true, description: true, search: false, tiles_loader: true, center_lat: 0, center_lon: 0, zoom: 10, time_slider: true, }) .done(function(vis, layers) { var slider = vis.getOverlay('time_slider') slider.formatter(function(d) { return d.getUTCMonth()+"-"+ d.getUTCDay() + " "+ d.getUTCHours() + ":"+ d.getUTCMinutes(); }) }) .error(function(err) { console.log(err); }); } window.onload = main;How can I fix it?



أكثر...
 
أعلى