public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: TAMUKI Shoichi <tamuki@linet.gr.jp>
To: libc-alpha@sourceware.org
Subject: [PATCH v5 2/5] strftime: Set the default width of "%Ey" to 2 [BZ #23758]
Date: Sun, 06 Jan 2019 06:36:00 -0000	[thread overview]
Message-ID: <201901060634.AA04158@tamuki.linet.gr.jp> (raw)
In-Reply-To: <201901060628.AA04156@tamuki.linet.gr.jp>

The Japanese era name is scheduled to be changed on May 1, 2019.
Prior to this, change the alternative representation for year in
strftime to pad the number with zero to keep it constant width, so
that prevent the trouble we saw in the past from becoming obvious
again from the year after the era name changes onward.

Since only one Japanese era name is used by each emperor's reign as
lately, it is rare that the year ends in one digit or lasts more than
three digits.  In addition, the default width of month, day, hour,
minute, and second is 2, so adjust the default width of year the same
as them, and then the whole display balance is improved.  Therefore,
it would be reasonable to set the default width padding with zero of
"%Ey" to 2.

ChangeLog:

	[BZ #23758]
	* time/strftime_l.c (__strftime_internal): Set the default width
	padding with zero of "%Ey" to 2.
---
 time/strftime_l.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/time/strftime_l.c b/time/strftime_l.c
index 7ba4179de3e..cbe08e7afb4 100644
--- a/time/strftime_l.c
+++ b/time/strftime_l.c
@@ -1294,7 +1294,7 @@ __strftime_internal (CHAR_T *s, size_t maxsize, const CHAR_T *format,
 	      if (era)
 		{
 		  int delta = tp->tm_year - era->start_date[0];
-		  DO_NUMBER (1, (era->offset
+		  DO_NUMBER (2, (era->offset
 				 + delta * era->absolute_direction));
 		}
 #else
-- 
2.12.2

  parent reply	other threads:[~2019-01-06  6:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-06  6:30 [PATCH v5 0/5] strftime: Improve the width of alternate representation for year " TAMUKI Shoichi
2019-01-06  6:36 ` [PATCH v5 1/5] strftime: Add missing uses of L_ macro, etc. " TAMUKI Shoichi
2019-01-09 10:08   ` Rafal Luzynski
2019-01-09 10:21     ` Siddhesh Poyarekar
2019-01-09 22:58       ` Rafal Luzynski
2019-01-11  4:54         ` TAMUKI Shoichi
2019-01-11 12:07           ` Rafal Luzynski
2019-01-11 14:21           ` Siddhesh Poyarekar
2019-01-10  0:46     ` TAMUKI Shoichi
2019-01-06  6:36 ` TAMUKI Shoichi [this message]
2019-01-09 10:13   ` [PATCH v5 2/5] strftime: Set the default width of "%Ey" to 2 " Rafal Luzynski
2019-01-09 10:25     ` Siddhesh Poyarekar
2019-01-09 23:02       ` Rafal Luzynski
2019-01-10  0:46     ` TAMUKI Shoichi
2019-01-06  6:36 ` [PATCH v5 3/5] strftime: Pass the additional flags from "%EY" to "%Ey" " TAMUKI Shoichi
2019-01-06  6:36 ` [PATCH v5 4/5] strftime: Add tst-strfitme2 " TAMUKI Shoichi
2019-01-06  6:54 ` [PATCH v5 5/5] strftime: Document the description for "%EC", "%Ey", and "%EY" " TAMUKI Shoichi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201901060634.AA04158@tamuki.linet.gr.jp \
    --to=tamuki@linet.gr.jp \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).