From c948fca8b9884315b8cfef4b23b922f0511c0d5c Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 6 Apr 2019 21:07:49 +0000
Subject: uplatex (6apr19)

git-svn-id: svn://tug.org/texlive/trunk@50811 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/uplatex/base/utbook.cls | 49 ++++++++++++++++-----------
 1 file changed, 29 insertions(+), 20 deletions(-)

(limited to 'Master/texmf-dist/tex/uplatex/base/utbook.cls')

diff --git a/Master/texmf-dist/tex/uplatex/base/utbook.cls b/Master/texmf-dist/tex/uplatex/base/utbook.cls
index 85a3dc8c961..ca20440b629 100644
--- a/Master/texmf-dist/tex/uplatex/base/utbook.cls
+++ b/Master/texmf-dist/tex/uplatex/base/utbook.cls
@@ -8,7 +8,7 @@
 %% 
 %% Copyright (c) 2010 ASCII MEDIA WORKS
 %% Copyright (c) 2016 Takuji Tanaka
-%% Copyright (c) 2016-2018 Japanese TeX Development Community
+%% Copyright (c) 2016-2019 Japanese TeX Development Community
 %% 
 %% This file is part of the upLaTeX2e system (community edition).
 %% --------------------------------------------------------------
@@ -16,7 +16,7 @@
 %% File: ujclasses.dtx
 \NeedsTeXFormat{pLaTeX2e}
 \ProvidesClass{utbook}
-  [2018/10/25 v1.8a-u00
+  [2019/04/02 v1.8b-u00
  Standard upLaTeX class]
 \newcounter{@paper}
 \newif\if@landscape \@landscapefalse
@@ -878,27 +878,36 @@
 \def\西暦{\西暦true}
 \def\和暦{\西暦false}
 \newcount\heisei \heisei\year \advance\heisei-1988\relax
-\def\today{{%
-  \iftdir
-    \if西暦
-      \kansuji\number\year 年
-      \kansuji\number\month 月
-      \kansuji\number\day 日
+\def\pltx@today@year@#1{%
+  \ifnum\numexpr\year-#1=1 元\else
+    \ifnum1=\iftdir\ifmdir0\else1\fi\else0\fi
+      \kansuji\number\numexpr\year-#1\relax
     \else
-      平成\ifnum\heisei=1 元年\else\kansuji\number\heisei 年\fi
-      \kansuji\number\month 月
-      \kansuji\number\day 日
+      \number\numexpr\year-#1\relax\nobreak
     \fi
+  \fi 年
+}
+\def\pltx@today@year{%
+  \ifnum\numexpr\year*10000+\month*100+\day<19890108
+    昭和\pltx@today@year@{1925}%
+  \else\ifnum\numexpr\year*10000+\month*100+\day<20190501
+    平成\pltx@today@year@{1988}%
   \else
-    \if西暦
-      \number\year~年
-      \number\month~月
-      \number\day~日
-    \else
-      平成\ifnum\heisei=1 元年\else\number\heisei~年\fi
-      \number\month~月
-      \number\day~日
-    \fi
+    令和\pltx@today@year@{2018}%
+  \fi\fi}
+\def\today{{%
+  \if西暦
+    \ifnum1=\iftdir\ifmdir0\else1\fi\else0\fi\kansuji\number\year
+    \else\number\year\nobreak\fi 年
+  \else
+    \pltx@today@year
+  \fi
+  \ifnum1=\iftdir\ifmdir0\else1\fi\else0\fi
+    \kansuji\number\month 月
+    \kansuji\number\day 日
+  \else
+    \number\month\nobreak 月
+    \number\day\nobreak 日
   \fi}}
 \newcommand{\prepartname}{第}
 \newcommand{\postpartname}{部}
-- 
cgit v1.2.3

