[Merge] lp:~artmello/webbrowser-app/webbrowser-app-bookmarks_top_sites into lp:webbrowser-app

Olivier Tilloy olivier.tilloy at canonical.com
Fri Jun 27 09:19:24 UTC 2014


It looks like this could be simplified:

249	+                start: {
250	+                    var date = new Date()
251	+                    date.setDate(date.getDate() - 60)
252	+                    date.setHours(0)
253	+                    date.setMinutes(0)
254	+                    date.setSeconds(0)
255	+                    date.setMilliseconds(0)
256	+                    return date
257	+                }
258	+                end: {
259	+                    var date = new Date()
260	+                    date.setDate(date.getDate())
261	+                    date.setHours(23)
262	+                    date.setMinutes(59)
263	+                    date.setSeconds(59)
264	+                    date.setMilliseconds(999)
265	+                    return date
266	+                }

For start, you don’t need to call setHours, setMinutes, setSeconds and setMilliseconds.
For end, you can just return a new Date(), i.e.: "end: new Date()"
-- 
https://code.launchpad.net/~artmello/webbrowser-app/webbrowser-app-bookmarks_top_sites/+merge/224592
Your team Ubuntu Phablet Team is subscribed to branch lp:webbrowser-app.



More information about the Ubuntu-reviews mailing list