mirror of https://github.com/espruino/BangleApps
[sleeplog] Correct deleteBefore function ... last
parent
ce1c8b8ae8
commit
d00cb89dea
|
@ -214,6 +214,9 @@ If you want to use other variables or functions from the trigger object inside t
|
|||
### Worth Mentioning
|
||||
---
|
||||
#### To do list
|
||||
- Optimize interface.html:
|
||||
- Open logfile through require("Storage") instead of require("sleeplog").
|
||||
- Give feedback how much files have been deleted on "delete all logfiles before".
|
||||
- Check translations.
|
||||
- Add more functionallities to interface.html.
|
||||
- Enable receiving data on the Gadgetbridge side + testing.
|
||||
|
|
|
@ -104,7 +104,7 @@ function deleteBefore(dateString, callback) {
|
|||
if (window.confirm("Do you really want to remove all data before " + date.toLocaleDateString(undefined))) {
|
||||
Util.showModal("Deleting all data before" + date.toLocaleDateString(undefined) + " ...");
|
||||
Puck.eval(`require("Storage").list(/^sleeplog_\\d+.log$/)` +
|
||||
`.filter(file => (parseInt(file.match(/\\d+/)[0]) + 0.25) * 12096E5 < ` + date.valueOf() + `)` +
|
||||
`.filter(file => (parseInt(file.match(/\\d+/)[0]) + 0.25) * 12096E5 < ` + date.valueOf() + ` - 12096E5)` +
|
||||
`.map(file => require("Storage").erase(file)).length`, count => {
|
||||
Util.hideModal();
|
||||
window.alert(count + " files deleted");
|
||||
|
|
Loading…
Reference in New Issue