[Tex/LaTex] How to (properly) remove the parentheses around the year in authoryear style

biblatex

Some time ago, Alan Munn asked and lockstep eloquently answered a question about removing parentheses from biblatex authoryear style references. Unfortunately, lockstep's solution injects an unwanted \addperiod\space into "dash" references. For example, given Author, A. cited twice:

\documentclass{article}

\usepackage[style=authoryear]{biblatex}
\usepackage{xpatch}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,author={Author, A.},year={2001},title={Alpha}}
@misc{A02,author={Author, A.},year={2001},title={Beta}}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*}

\begin{document}

\printbibliography

\xpatchbibmacro{date+extrayear}{%
  \printtext[parens]%
}{%
  \addperiod\space%
  \printtext%
}{}{}

\printbibliography

\end{document}

we get:

enter image description here

I've tried building a solution using constructs like \usebibmacro{bbx:dashcheck} without success. How, then, based on lockstep's nice xpatch-based approach, can I conditionally include \addperiod\space only in the case of "non-dash" references?

Best Answer

The output of units should be done inside the command \setunit.

\xpatchbibmacro{date+extrayear}{%
  \printtext[parens]%
}{%
  \setunit{\addperiod\space}%
  \printtext%
}{}{}

enter image description here