comparison mercurial/templatefuncs.py @ 50372:164b6c4878b8 stable

doc: format argument for date uses strftime format string (issue6818)
author Joerg Sonnenberger <joerg@bec.de>
date Wed, 31 May 2023 22:36:50 +0200
parents 63fd0282ad40
children 92c7765931e0
comparison
equal deleted inserted replaced
50371:7b723217d368 50372:164b6c4878b8
48 templatefunc = registrar.templatefunc(funcs) 48 templatefunc = registrar.templatefunc(funcs)
49 49
50 50
51 @templatefunc(b'date(date[, fmt])') 51 @templatefunc(b'date(date[, fmt])')
52 def date(context, mapping, args): 52 def date(context, mapping, args):
53 """Format a date. See :hg:`help dates` for formatting 53 """Format a date. The format string uses the Python strftime format.
54 strings. The default is a Unix date format, including the timezone: 54 The default is a Unix date format, including the timezone:
55 "Mon Sep 04 15:13:13 2006 0700".""" 55 "Mon Sep 04 15:13:13 2006 0700"."""
56 if not (1 <= len(args) <= 2): 56 if not (1 <= len(args) <= 2):
57 # i18n: "date" is a keyword 57 # i18n: "date" is a keyword
58 raise error.ParseError(_(b"date expects one or two arguments")) 58 raise error.ParseError(_(b"date expects one or two arguments"))
59 59