Mercurial > hg
view doc/Makefile @ 15375:fe9d36a6853e stable
hgweb: fix dynamic date calculation not working under Safari
While Chrome, Firefox, and IE 6+ support the current date format being
passed to Date(), Safari doesn't:
> new Date('Mon Oct 24 13:58:01 2011 +0200')
Invalid Date
However, the rfc822date format--officially supported by
ECMAScript[1]--does work:
> new Date('Mon, 24 Oct 2011 13:58:01 +0200')
Mon Oct 24 2011 04:58:01 GMT-0700 (PDT)
This change replaces all instances of {date|date} in HTML with
{date|rfc822date}. For elements that only have the "age" class,
there's no outward change for users with JavaScript enabled. For
elements with both the "age" and "date" classes, the full date
displayed uses the new format.
Tested in IE 6, Safari 5.1.1, Google Chrome 15, and Firefox 7.0.1.
[1]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Thu, 27 Oct 2011 11:57:08 -0700 |
parents | 323c11dad9c6 |
children | 81fbd4e66ff5 |
line wrap: on
line source
SOURCES=$(wildcard *.[0-9].txt) MAN=$(SOURCES:%.txt=%) HTML=$(SOURCES:%.txt=%.html) GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py \ ../mercurial/help/*.txt ../hgext/*.py ../hgext/*/__init__.py PREFIX=/usr/local MANDIR=$(PREFIX)/share/man INSTALL=install -c -m 644 PYTHON=python RSTARGS= export LANGUAGE=C export LC_ALL=C all: man html man: $(MAN) html: $(HTML) hg.1.txt: hg.1.gendoc.txt touch hg.1.txt hg.1.gendoc.txt: $(GENDOC) ${PYTHON} gendoc.py > $@.tmp mv $@.tmp $@ hgrc.5: ../mercurial/help/config.txt hgrc.5.html: ../mercurial/help/config.txt %: %.txt common.txt $(PYTHON) runrst hgmanpage $(RSTARGS) --halt warning \ --strip-elements-with-class htmlonly $*.txt $* %.html: %.txt common.txt $(PYTHON) runrst html $(RSTARGS) --halt warning \ --link-stylesheet --stylesheet-path style.css $*.txt $*.html MANIFEST: man html # tracked files are already in the main MANIFEST $(RM) $@ for i in $(MAN) $(HTML); do \ echo "doc/$$i" >> $@ ; \ done install: man for i in $(MAN) ; do \ subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \ mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ done clean: $(RM) $(MAN) $(HTML) hg.1.gendoc.txt MANIFEST