// logs.js const util = require('../../utils/util.js') Page({ data: { logs: [] }, onLoad() { this.setData({ logs: (my.getStorageSync({'key':'home'}).data || []).map(log => { return { date: util.formatTime(new Date(log)), timeStamp: log } }) }) } })