[Tex/LaTex] Strange behaviour in biblatex @online without year

biblatexonline

\documentclass[12pt,english,a4paper]{report}

\usepackage[backend=biber,
%           natbib=true
        style=ieee,
        sorting=none,
        doi=false,
        isbn=false,
        url=true,
        urldate=long,
        ]{biblatex} % best for bibliography

\usepackage{filecontents}

\begin{filecontents}{references.bib}
@Online{stack,
title     = {stackexchange},
url       = {http://tex.stackexchange.com/},
urldate   = {2016-08-30},
}
    \end{filecontents}


\DefineBibliographyStrings{english}{urlseen = {Last accessed:},}

\addbibresource{references.bib}


\begin{document}
\cite{stack}
\printbibliography
\end{document}

gives this

  1. starting (). should be removed.

\AtEveryBibitem{%
\ifentrytype{Online}{%
\clearfield{labelyear}%
}{%
}%
}
not working

  1. Available: => Available at:
  2. (Last accessed: ) => without bracket

Please don't change filecontents.

Best Answer

Since date/year is a mandatory field biblatex-ieee expects there to be one and does not check if the year is missing to avoid empty brackets. We can do that - the check is inserted using the xpatch package to avoid rewriting the driver -

\usepackage{xpatch}
\xpatchbibdriver{online}
  {\printtext[parens]{\usebibmacro{date}}}
  {\iffieldundef{year}{}{\printtext[parens]{\usebibmacro{date}}}}
  {}{}

Item 2 should be dealt with with

\DefineBibliographyStrings{english}{url = [Online]\adddot\addspace Available at,}

Finally, there is

\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}

for the third point.

MWE

\documentclass[12pt,english,a4paper]{report}

\usepackage[backend=biber,
%           natbib=true
        style=ieee,
        sorting=none,
        doi=false,
        isbn=false,
        url=true,
        urldate=long,
        ]{biblatex} % best for bibliography

\usepackage{filecontents}

\begin{filecontents}{references.bib}
@Online{stack,
title     = {stackexchange},
url       = {https://tex.stackexchange.com/},
urldate   = {2016-08-30},
}
    \end{filecontents}


\DefineBibliographyStrings{english}{urlseen = {Last accessed:},}

\addbibresource{references.bib}


\usepackage{xpatch}
\xpatchbibdriver{online}
  {\printtext[parens]{\usebibmacro{date}}}
  {\iffieldundef{year}{}{\printtext[parens]{\usebibmacro{date}}}}
  {}{}

\DefineBibliographyStrings{english}{url = [Online]\adddot\addspace Available at,}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}

\begin{document}
\cite{stack}
\printbibliography
\end{document}

[1] Stackexchange, [Online]. Available at: https://tex.stackexchange.com/ Last accessed: Aug. 30, 2016.

Related Question