日历系列-查询本地日历数据库
查询所有:select title,description,strftime("%Y.%m.%d %H:%M:%S",dtstart/1000,"unixepoch"),strftime("%Y.%m.%d %H:%M:%S",dtend/1000,"unixepoch"),allday from Events;
查询还没进行的日历项:select title,description,strftime("%Y.%m.%d %H:%M:%S",dtstart/1000,"unixepoch"),strftime("%Y.%m.%d %H:%M:%S",dtend/1000,"unixepoch"),allday from Events WHERE dtstart > strftime('%s','now')*1000;
查询明天的日历项:select title,description,strftime("%Y.%m.%d %H:%M:%S",dtstart/1000,"unixepoch"),strftime("%Y.%m.%d %H:%M:%S",dtend/1000,"unixepoch"),allday from Events WHERE round(strftime("%J", dtstart/1000, "unixepoch")) - round(strftime("%J", "now")) = 1;
(最后的1是指距离当前日期的日期差,同理后天的可以改为2,如果拓展为本周内可以写为:select title,description,strftime("%Y.%m.%d %H:%M:%S",dtstart/1000,"unixepoch"),strftime("%Y.%m.%d %H:%M:%S",dtend/1000,"unixepoch"),allday from Events WHERE round(strftime("%J", dtstart/1000, "unixepoch")) - round(strftime("%J", "now")) =>1 AND round(strftime("%J", dtstart/1000, "unixepoch")) - round(strftime("%J", "now")) =< 7;
