Latest news 2021-09-06: new blog post "Legacy Documents and TeX Live Docker Images".

Feature Tracker

ID 43🔗
Date: 2016-11-16 10:35:29
Status Open
Category datetime2
Summary saved date conditionals

Sign in to subscribe to notifications about this report.

Description

<a> and <b> are two saved dates.
\DTMsavedifdiffdate{<a>}{<b>}{<if a!=b>}{<if a==b>}
\DTMsavedifnewerdate{<a>}{<b>}{<if a newer than b>}{<if a not newer than b>}
Here is the code (it is easy to add ifdifftime or ifdiffdatetime) :
\newcommand*\dtm@save@ifop[5]{{
  \let\@tempa\@gobbletwo
  \ifcsundef{@dtm@#4@year}%
  {%
    \PackageError{datetime2}{Undefined date-time `#4'}{}%
  }{%
    \ifcsundef{@dtm@#5@year}%
    {%
      \PackageError{datetime2}{Undefined date-time `#5'}{}%
    }{%
      \def\@tempb##1,{%
         \def\@tempc{##1}%
         \ifx\@tempc\@nnil
           \let\@tempa\@secondoftwo
           \let\@tempb\@empty
         \else
           #1\ifnum\csname @dtm@#4@##1\endcsname#2\csname @dtm@#5@##1\endcsname
             \let\@tempa\@firstoftwo
             \def\@tempb####1\@nil,{}%
           \fi
         \fi
         \@tempb
      }
      \@tempb#3,\@nil,%
    }
  }
  \expandafter}\@tempa
}
\newcommand*\DTMsavedifdiffdate{%
   \dtm@save@ifop\unless={year,month,day}}
\newcommand*\DTMsavedifnewerdate{%
   \dtm@save@ifop\@empty>{year,month,day}}

MWE

No mwe.tex

Evaluation

Comments

0 comments.


Add Comment

Name (optional):

Are you human? Please confirm the feature request ID (which can be found at the top of this page) or login if you have an account.

Comment:

You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/featuretracker.php?key=43