remove date db column

This commit is contained in:
Marco Martin 2015-04-28 12:23:36 +02:00
parent 75c672dc5f
commit cff41cc6c0
2 changed files with 5 additions and 6 deletions

View file

@ -93,11 +93,8 @@ Item {
}
section {
property: "date"
labelPositioning: ViewSection.CurrentLabelAtStart
delegate: PlasmaComponents.ListItem {
//width: view.width
//height: childrenRect.height
//color: syspal.base
id: sectionItem
sectionDelegate: true
PlasmaComponents.Label {
text: Qt.formatDate(section, Qt.locale().dateFormat(Locale.LongFormat));

View file

@ -109,12 +109,13 @@ ApplicationWindow {
db.transaction(
function(tx) {
var rs = tx.executeSql("INSERT INTO History VALUES(NULL, ?, date('now'), datetime('now'), ?, ? )", [number, duration, callType]);
var rs = tx.executeSql("INSERT INTO History VALUES(NULL, ?, datetime('now'), ?, ? )", [number, duration, callType]);
var rs = tx.executeSql('SELECT * FROM History where id=?', [rs.insertId]);
for(var i = 0; i < rs.rows.length; i++) {
var row = rs.rows.item(i);
row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
row.originalIndex = historyModel.count;
historyModel.append(row);
}
@ -168,12 +169,13 @@ ApplicationWindow {
function(tx) {
// Create the database if it doesn't already exist
//callType: wether is incoming, outgoing, unanswered
tx.executeSql('CREATE TABLE IF NOT EXISTS History(id INTEGER PRIMARY KEY AUTOINCREMENT, number TEXT, date DATE, time DATETIME, duration INTEGER, callType INTEGER)');
tx.executeSql('CREATE TABLE IF NOT EXISTS History(id INTEGER PRIMARY KEY AUTOINCREMENT, number TEXT, time DATETIME, duration INTEGER, callType INTEGER)');
var rs = tx.executeSql('SELECT * FROM History');
for(var i = 0; i < rs.rows.length; i++) {
var row = rs.rows.item(i);
row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
row.originalIndex = historyModel.count;
historyModel.append(row);
}