[Tex/LaTex] biblatex – “n.d.” when no date given

biblatex

I'd like to have "(n.d.)" printed for a bibliography entry when no date is given. So far have already found a solution here, but the rest of my style code apparently changes something. Could anyone change that specific part? Currently it works just fine for the references, but not at all in the bibliography.

enter image description here

MWE

\documentclass[
12pt,
a4paper
]
{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage[
language=auto,
style=authoryear-ibid,
backend=biber,
hyperref=true,
isbn=false,
dashed=false,
doi=false,
citereset=chapter,
maxcitenames=3,
sorting=nyt,
firstinits=true,
uniquename=init,
ibidtracker=true,
maxbibnames=99,
urldate=iso8601,
%mergedate=true, %Audrey https://tex.stackexchange.com/questions/126584/biblatex-n-d-when-no-date-given?noredirect=1#comment284550_126584
labeldate=true
]{biblatex}
\usepackage{xpatch}

%%  parentheses around year in references
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
{}
{% 
\printtext[bibhyperref]{%
\printtext[parens]{%
\printfield{labelyear}%
\printfield{extrayear}}}}}

%% no date given
\newcommand{\mkbibnodate}{n\adddot d\adddot}
\AtEveryCitekey{\iffieldundef{labelyear}{\restorefield{labelyear}{\mkbibnodate}}{}}
\AtEveryBibitem{\iffieldundef{year}{\restorefield{labelyear}{\mkbibnodate}}{}}

%% correct order of publisher and location
\renewbibmacro*{publisher+location+date}{%
\newunit
\printlist{publisher}%
\newunit
\printlist{location}%
\newunit}

%%  right order of words 'volume' und 'issue' with comma in front
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}
  \setunit{\addcomma\space}% THIS LINE CHANGED to add comma
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}
%taken from standard.bbx
\renewbibmacro*{issue+date}{%
  \printtext{%   REMOVED parenthesis here
    \iffieldundef{issue}
      {\usebibmacro{date}}
      {\printfield{issue}%
       \setunit*{\addspace}%
       \usebibmacro{date}}}%
  \newunit}


%% linebreak before URLs and colon before date of last visit
\xpretobibmacro{url+urldate}{\setunit{\newunitpunct\par\nobreak}}{}{}
\DefineBibliographyStrings{english}{%
urlseen = {last visit\addcolon}
}

%% colon before date of last visit
\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\addcolon\space#1}}

\begin{filecontents*}{lit.bib}
@Online{ctan,
label         = {CTAN},
hyphenation   = {american},
title         = {CTAN},
subtitle      = {The Comprehensive TeX Archive Network},
url       = {http://www.ctan.org},
urldate   = {2006-10-01}
}
@Book{augustine,
hyphenation   = {american},
author    = {Augusteine, Robert L.},
title         = {Heterogeneous catalysis for the synthetic chemist},
shorttitle    = {Heterogeneous catalysis},
publisher     = {Marcel Dekker},
location      = {New York},
edition={5}
}
@Article{bertram,
author       = {Bertram, Aaron and Wentworth, Richard},
title        = {Gromov invariants for holomorphic maps on Riemann surfaces},
journaltitle = jams,
year         = 1996,
volume       = 9,
number       = 2,
pages        = {529-571}
}
@InCollection{hyman,
author       = {Arthur Hyman},
editor       = {O'Meara, Dominic J.},
title        = {Aristotle's Theory of the Intellect and its Interpretation by
                                Averroes},
booktitle    = {Studies in Aristotle},
series       = {Studies in Philosophy and the History of Philosophy},
number       = 9,
publisher    = {The Catholic University of America Press},
location     = {Washington, D.C.},
pages        = {161-191}
}

\end{filecontents*}

\addbibresource{lit.bib}

\begin{document}
\chapter{First Chapter}
\begin{itemize}
    \item This is a test for the case if no year was given for \verb+@online+ source.\footcite[See][p. 3]{ctan}.
    \item Another sentence for the parentheses.\footnote{\cite[See][p. 456.]{augustine}}
    \item Words for the \verb+article+-type.\footnote{\cite[See][p. B.]{bertram}}
    \item Soem stuff for \verb+incollection+.\footnote{\cite[See][p. 456.]{hyman}}
\end{itemize}
\printbibliography
\end{document}

Best Answer

As Audrey said in the comments, the answer is to remove urldate as a fallback date label

\DeclareLabeldate{\field{date}\field{eventdate} \field{origdate}\literal{nodate}}

Here's a MWE:

\documentclass{article}
\begin{filecontents*}{\jobname.bib}
@Online{ctan,
label         = {CTAN},
hyphenation   = {american},
title         = {CTAN},
subtitle      = {The Comprehensive TeX Archive Network},
url       = {http://www.ctan.org},
urldate   = {2006-10-01}
}
@Book{augustine,
hyphenation   = {american},
author    = {Augusteine, Robert L.},
title         = {Heterogeneous catalysis for the synthetic chemist},
shorttitle    = {Heterogeneous catalysis},
publisher     = {Marcel Dekker},
location      = {New York},
edition={5}
}
@Article{bertram,
author       = {Bertram, Aaron and Wentworth, Richard},
title        = {Gromov invariants for holomorphic maps on Riemann surfaces},
journaltitle = {jams},
year         = 1996,
volume       = 9,
number       = 2,
pages        = {529-571}
}
@InCollection{hyman,
author       = {Arthur Hyman},
editor       = {O'Meara, Dominic J.},
title        = {Aristotle's Theory of the Intellect and its Interpretation by
                                Averroes},
booktitle    = {Studies in Aristotle},
series       = {Studies in Philosophy and the History of Philosophy},
number       = 9,
publisher    = {The Catholic University of America Press},
location     = {Washington, D.C.},
pages        = {161-191}
}
\end{filecontents*}
\usepackage[style=authoryear-ibid]{biblatex}
\addbibresource{\jobname.bib}
\DeclareLabeldate{
  \field{date}
  \field{eventdate} 
  \field{origdate}
  \literal{nodate}
}
\begin{document}
\autocites[See][3]{ctan}[See][456]{augustine}[See][B]{bertram}[See][456]{hyman}
\printbibliography
\end{document}

enter image description here