Неправильно отображается дата в скрипте
Здравствуйте! Помогите разобраться с date в коде.
везде показывает дату 1970-01-18 чего не хватает в коде для правильного отображения даты и времени? $(function () { var online = [], colors = Highcharts.getOptions().colors; online[0] = { name: 'Онлайн', data: {chart}, type: 'spline', tooltip: { valueDecimals: 2 } }; online[1] = { name: 'CPU', data: {chart2}, type: 'spline', tooltip: { valueDecimals: 2 } }, online[2] = { name: 'RAM', data: {chart3}, type: 'spline', tooltip: { valueDecimals: 2 } }, online[3] = { name: 'HDD', data: {chart4}, type: 'spline', tooltip: { valueDecimals: 2 } }; Highcharts.setOptions({ lang: { rangeSelectorZoom: 'Период', rangeSelectorFrom: 'С', rangeSelectorTo: 'По', printChart: 'Печать диаграммы', downloadPNG: 'Скачать PNG изображение', downloadJPEG: 'Скачать JPEG изображение', downloadPDF: 'Скачать PDF документ', downloadSVG: 'Скачать SVG изображение', contextButtonTitle: 'Контекстное меню графика', months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'], shortMonths: ['Янв.', 'Фев.', 'Март.', 'Апр.', 'Май.', 'Июнь.', 'Июль.', 'Авг.', 'Сент.', 'Окт.', 'Ноя.', 'Дек.'] } }); setTimeout(function () { $('#container').highcharts('StockChart', { credits: {enabled: false}, xAxis: { type: 'datetime', dateTimeLabelFormats: { second: '%H:%M:%S', minute: '%H:%M', hour: '%H:%M', day: '%e.%m', week: '', month: '%m', year: '%Y' } }, yAxis: { allowDecimals: false, min: 0 }, scrollbar: { barBackgroundColor: 'gray', barBorderRadius: 7, barBorderWidth: 0, buttonBackgroundColor: 'gray', buttonBorderWidth: 0, buttonBorderRadius: 7, trackBackgroundColor: 'none', trackBorderWidth: 1, trackBorderRadius: 8, trackBorderColor: '#CCC' }, rangeSelector: { inputEnabled: $('#container').width() > 480, selected: 0, buttonTheme: { width: 50 }, buttons: [{ type: 'day', count: 1, text: 'ДЕНЬ' }, { type: 'week', count: 1, text: 'НЕДЕЛЯ' }, { type: 'month', count: 1, text: 'МЕСЯЦ' }, { type: 'year', count: 1, text: 'ГОД' }, { type: 'all', text: 'ВЕСЬ' }] }, tooltip: { formatter: function () { var s = '<b>Дата: ' + Highcharts.dateFormat('%e.%m.%Y - %H:%M', this.x) + '</b>'; $.each(this.points, function (i, point) { if (online[i].name != "Онлайн") { var d = "%"; } else { var d = ""; } s += '<br/><span style="color:' + this.series.color + '">' + this.series.name + '</span>: ' + point.y + d; }); return s; } }, series: online }); }, 100); }); |
Часовой пояс GMT +3, время: 01:47. |