use tool.js at both server and client,add Date.getDayStart and Date.getDayEnd tool
fix text