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"}
];
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>
Find more questions by tags JavaScript
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
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
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
return to slip in a div with display:none and there to enter time in this format 201711292215
Type this:
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