Hej, mam taki przykłądowy kod:
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization',
'version':'1','packages':['timeline']}]}"></script>
<script type="text/javascript">
google.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('example5.2');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Room' });
dataTable.addColumn({ type: 'string', id: 'Name' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'Magnolia Room', 'CSS Fundamentals', new Date(0
,0
,0
,12
,0
,0
), new Date(0,0,0,14,0,0) ], [ 'Gladiolus Room', 'Intermediate Perl', new Date(0
,0
,0
,12
,30
,0
), new Date(0,0,0,14,0,0) ], [ 'Petunia Room', 'Google Charts', new Date(0
,0
,0
,12
,30
,0
), new Date(0
,0
,0
,14
,0
,0
) ],
var options = {
timeline: { singleColor: '#8d8' },
};
chart.draw(dataTable, options);
}
</script>
<div id="example5.2" style="width: 780px; height: 200px;"></div>
Problem w tym, że wyświetla mi sie czas w formacie AM/PM. Zlazłem takie coś, jak
google.visualization.DateFormat ale nie potrafię tego zastosować do powyższego przykładu. JS dopiero raczkuję, dlatego czy mogę prosić bardziej doświadczone osoby o jakąś wskazówkę?