I have stored the date and time in datetime-local format in indexeddb . Now when I am reading the values from the database, I need dates and time which are later than current datetime so I am using the following code for it -
var transaction = db.transaction(["trips"],"readonly");
var store = transaction.objectStore("trips");
var myindex = store.index("startDate");
range = IDBKeyRange.lowerBound("tizen.time.getCurrentDateTime()");
myindex.openCursor(range).onsuccess = function(e) {
var cursor = e.target.result;
if(cursor) {
var tableRow = document.createElement('tr');
tableRow.innerHTML = '<td>' + cursor.value.destination + '</td>'
+ '<td>' + cursor.value.startDate + '</td>'
+ '<td>' + cursor.value.endDate + '</td>'
+ '<td>' + cursor.value.notes + '</td>';
tableEntry.appendChild(tableRow);
cursor.continue();
} else {
console.log('Entries all displayed.');
}
}
I am entering these values in a table so basically I need to know what should be given as parameter to the lowerbound statement instead of "tizen.time.getCurrentDateTime()"-
range = IDBKeyRange.lowerBound("tizen.time.getCurrentDateTime()");