Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Added forced reduction to Date object #781

wants to merge 1 commit into from

2 participants



I use Mac OS and I have some issues.

My meta-data for index.hmtl

title: ''
layout: 'default'
dynamic: true
standalone: true

When I run docpad server --env ru files with css and javascript not loaded, because I see 500 error.

In console I have this: TypeError: Object 2014-01-25T14:49:35.294Z has no method 'toUTCString'
In Headers on page I saw that Etag have not valid value.

Response Headers

Date:Sat, 25 Jan 2014 12:56:27 GMT
X-Powered-By:Express, DocPad v6.60.3

It fix make Date object from mtime date always.


This is a good interim fix. Ideally we need to find out why they aren't date objects in the first place.

Would you like me to merge this in for the meantime?


Okey, I will try find place with error deeper. I need some time and I think we can save this PR opened.


Implemented a workaround in v6.60.4.

@balupton balupton closed this
@balupton balupton referenced this pull request from a commit
@balupton balupton v6.60.4. Improvement. Bugfix.
- v6.60.4 January 27, 2014
	- Implemented `304 Not Modified` header
	- Fixed some `date` and `stat` errors (regression since v6.60.0)
		- Thanks to [Anton Wilhelm]( for [pull
request #787](#787)
		- Thanks to [Ivan Klimchuk]( for [pull
request #781](#781)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 25, 2014
  1. @Alroniks
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/lib/
4 src/lib/
@@ -4509,8 +4509,8 @@ class DocPad extends EventEmitterGrouped
# ETag: `"<size>-<mtime>"`
- ctime = document.get('date') # use the date or mtime, it should always exist
- mtime = document.get('wtime') # use the last generate time, it may not exist though
+ ctime = new Date(document.get('date')) # use the date or mtime, it should always exist
+ mtime = new Date(document.get('wtime')) # use the last generate time, it may not exist though
stat = document.getStat()
res.setHeaderIfMissing('ETag', '"' + stat.size + '-' + Number(mtime) + '"') if mtime
Something went wrong with that request. Please try again.