Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

comma-it is for views only, not models

  • Loading branch information...
commit 95e0d43a379b8cc3d9e55574f3c37bfd3c8ca52c 1 parent 215274b
@isaacs isaacs authored
Showing with 6 additions and 9 deletions.
  1. +6 −9 routes/package-page.js
View
15 routes/package-page.js
@@ -17,12 +17,9 @@ function packagePage (req, res) {
var month = Date.now() - 1000 * 60 * 60 * 24 * 31
var week = Date.now() - 1000 * 60 * 60 * 24 * 8
var end = Date.now() - 1000 * 60 * 60 * 24
- var endWComma = commaIt(end)
- var weekWComma = commaIt(week)
- var monthWComma = commaIt(month)
- req.model.loadAs('downloads', 'dlDay', endWComma, end, name, false)
- req.model.loadAs('downloads', 'dlWeek', weekWComma, end, name, false)
- req.model.loadAs('downloads', 'dlMonth', monthWComma, end, name, false)
+ req.model.loadAs('downloads', 'dlDay', end, end, name, false)
+ req.model.loadAs('downloads', 'dlWeek', week, end, name, false)
+ req.model.loadAs('downloads', 'dlMonth', month, end, name, false)
req.model.end(function (er, m) {
if (er && er.code === 'E404') return res.error(404, er)
@@ -47,9 +44,9 @@ function packagePage (req, res) {
package: p,
profile: m.profile,
title: m.package.name,
- dlDay: m.dlDay,
- dlMonth: m.dlMonth,
- dlWeek: m.dlWeek
+ dlDay: commaIt(m.dlDay),
+ dlMonth: commaIt(m.dlMonth),
+ dlWeek: commaIt(m.dlWeek)
}
res.template("package-page.ejs", locals)
})
Please sign in to comment.
Something went wrong with that request. Please try again.