From 8c56125a7b56617369d11cecb0c69359d323da7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?GOLDERWEB=20=E2=80=93=20Jonathan=20Golder?= Date: Tue, 30 Aug 2016 12:07:11 +0200 Subject: [PATCH] Update talkpage notice template Exact date is not necessary and end could be ommited if of the same month Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=93 FS#93] --- lib/redfam.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/redfam.py b/lib/redfam.py index 9889908..f0b36fd 100644 --- a/lib/redfam.py +++ b/lib/redfam.py @@ -554,12 +554,13 @@ class RedFamWorker( RedFam ): param_cnt += 1 # Add begin - template.add( "Beginn", self._mysql.data[ 'beginning' ].strftime( - "%d. %B %Y").lstrip("0"), True ) + begin = self._mysql.data[ 'beginning' ].strftime( "%B %Y" ) + template.add( "Beginn", begin, True ) - # Add end - template.add( "Ende", self._mysql.data[ 'ending' ].strftime( - "%d. %B %Y").lstrip("0"), True ) + # Add end (if not same as begin) + end = self._mysql.data[ 'ending' ].strftime( "%B %Y" ) + if not end == begin: + template.add( "Ende", end, True ) # Add link to related reddisc template.add( "Diskussion", self.get_disc_link(), True )