How best to pull data out of the array in ascending time order?

For example, there is an array
plan = [
{"start":"201711292215","end":"201711292345","title":"Right to power","channel":"1+1 International"},{"start":"201711291300","end":"201711291545","title":"Right to power","channel":"1+1 International"},{"start":"201711292345","end":"201711300030","title":"Svit neweport. Japan","channel":"1+1 International"}
];


There is a function which converts the start and end of JS Date object

So put in html, but how to do that would be in ascending time order

var all = plan.length;
var items = ";
 for (i = 0; i < all; i++) {
var time = inputdate(plan[i].start);
items += '<li><strong>'+time.hour+':'+time.min+'</strong>'+plan[i].title+'</li>';
}
$('ul').html(items);
the <ul></ul>
June 10th 19 at 14:26
1 answer
June 10th 19 at 14:28
Solution
if the time does not show, and to translate it to a date makes no sense
sort timstamp
Show
for (i = 0; i < all; i++) {
var time = inputdate(plan[i].start);
items += ''+time.hour+':'+time.min+''+plan[i].title+";
}
But sorting will as written
just before sorting, create a separate sorted array is not sorted from because the array is stored in LocalStorage and every time to sort before recording if suddenly what that element was removed or added expensive - Telly_Davis65 commented on June 10th 19 at 14:31
, datatables works well for such cases - Pedro65 commented on June 10th 19 at 14:34
, Well, something interesting ) and he was only working with tables ? - Telly_Davis65 commented on June 10th 19 at 14:37
all can be called table :)
appearance customizable via css
but with this plugin you only need to provide it with json and specify what and where to take and not to wrestle with sorting - Pedro65 commented on June 10th 19 at 14:40
maybe some plugins tell ?) simpler, but then there aahy different, etc.) a lot of extra - Telly_Davis65 commented on June 10th 19 at 14:43
then you mobile phone to trade if it is difficult :) - Pedro65 commented on June 10th 19 at 14:46
There was too much I mean ) - Telly_Davis65 commented on June 10th 19 at 14:49
in pieces but all the beam - Pedro65 commented on June 10th 19 at 14:52
, )), Yes) but there's a bunch of documentation in English language. okay if I often tables worked, it would be possible to study ) and then for a single event to dig tons of docks is not so hot - Telly_Davis65 commented on June 10th 19 at 14:55
Like all fine works), but there is a caveat
columns: [
{ data: function (data) {
var t = inputdate(data.start)
year = t.year,
month = t.month,
day = t.day
hour = t.hour
min = t.min;
var date2 = year+'.'+month+'.'+day;
var rTime = realtime();
if (day == rTime.day){
date2 = 'Today';
} else if (day == changeday(rTime,'1').day){
date2 = 'Tomorrow';
}
return hour+':'+min+'
'+date2;
} },
{ data: 'title'},
{ data: 'channel' }
]

In the first column to sort something not very good work ) can you tell me what to do, if no function in this form 201711292215 normally sorted in ascending order with the function breaks something ) it should be like that time in the attribute column for example to put in this form 201711292215, and the column display type as "22:15
Today, the" or so "22:15
2017.11.30" - Telly_Davis65 commented on June 10th 19 at 14:58
So far I've found this solution:
return to slip in a div with display:none and there to enter time in this format 201711292215
Type this:
columns: [
{ data: function (data) {
var t = inputdate(data.start)
year = t.year,
month = t.month,
day = t.day
hour = t.hour
min = t.min;
var date2 = year+'.'+month+'.'+day;
var rTime = realtime();
if (day == rTime.day){
date2 = 'Today';
} else if (day == changeday(rTime,'1').day){
date2 = 'Tomorrow';
} 
return '<div style="display:none">'+data.start+'</div>'+hour+':'+min+'
'+date2;
} },
{ data: 'title'},
{ data: 'channel' }
]

XS if it's right, but it works)
now another problem, there is a timer, it compares the time data from the array with real time, and if the time has come, or not come it puts an appropriate status. And what about the update data in the table ?) each time it is redrawn ?)) - Telly_Davis65 commented on June 10th 19 at 15:01

Find more questions by tags JavaScript