# Remove “n.d.” from online entries without date in biblatex-chicago

For an undated website I would like to remove (n.d.) from the citation and the reference. I tried to adapt the solution here to biblatex-chicago but I guess it is some other macros which will need to be redefined:

\documentclass{article}
\usepackage[authordate,backend=biber,indexing=true]{biblatex-chicago}
%\usepackage[style=authoryear-comp]{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{lennon,
AUTHOR = "John Lennon",
TITLE = "Who did what in the Beatles"}
\end{filecontents}

\ifboolexpr{test {\iffieldundef{labelyear}}
or (test {\iffieldequalstr{labelyear}{nodate}}
and test {\ifentrytype{online}})}
{}
{\printtext[parens]{%
\iflabeldateisdate
{\printdateextra}
{\printlabeldateextra}}}}

\ifboolexpr{test {\iffieldundef{labelyear}}
or (test {\iffieldequalstr{labelyear}{nodate}}
and test {\ifentrytype{online}})}
{}
{\printtext[bibhyperref]{\printlabeldateextra}}}

\begin{document}
\printbibliography
\end{document}


• But you want the "n.d" for the book, right? – moewe Jul 28 '18 at 9:04
• @moewe Ideally yes, but if it considerably simplifies the solution I could live without n.d. for books. – muk.li Jul 28 '18 at 9:08
• I'll see what I can do, highly customised styles like biblatex-chicago and biblatex-apa can be much harder to modify than the standard styles. – moewe Jul 28 '18 at 9:39

For the "nodate" detection, biblatex-chicago treats a missing labelyear and an explicit literal nodate inserted by \DeclareLabeldate alike, so we can't use the improved answer to Remove "n.d." (no date) from online entries without dates in biblatex.

But biblatex-chicago has the option nodates (from the biblatex-chicago manual, p. 121)

nodates=true This option means that for all entry types except inreference, misc, and reference, biblatex-chicago will automatically provide \bibstring{nodates} for any entry that doesn’t otherwise provide a date for citations and for the heads of entries in the list of references. If you set nodates=false in your preamble, then the package won’t perform this substitution in any entry type whatsoever. (The bibstring expands to “n.d.” in English.)

Unfortunately, that option applies to all type (save for the three exception listed above), but we can make that option type specific with only a few lines of code. We then set nodate=false only for @online entries, while all other entries retain the default nodate=true.

\documentclass{article}
\usepackage[authordate,backend=biber,indexing=true]{biblatex-chicago}
%\usepackage[style=authoryear-comp]{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{lennon,
AUTHOR = "John Lennon",
TITLE = "Who did what in the Beatles"}
author = {Victor},
\end{filecontents}