# Formatting the year in biblatex bibliograpy driver (.bbx) files

Normally, to set the format of a field using biblatex, the \DeclareFieldFormat macro can be used, for example

\DeclareFieldFormat[article]{title}{\mkbibemph{#1}}


However, this approach fails for the year. Trying either

\DeclareFieldFormat{year}{\mkbibbobld{#1}}


or

\DeclareFieldFormat{date}{\mkbibbold{#1}}


Makes no difference to the output. You can do something like

\renewbibmacro*{date}{\mkbibbold{\printdate}}


to format the date, but this looses the link to bibliography entry type and thus requires more work for type-dependent appearance. Is there a better approach, ideally sticking to \DeclareFieldFormat?

-
I think this doesn't work because dates are printed with the \printdate command and not the \printfield command. – Alan Munn Aug 14 '11 at 16:28
@Alan: Yes, that is my take, but then there is no \DeclareDateFormat! – Joseph Wright Aug 14 '11 at 17:12

Update:

Today (14 nov) biblatex v 1.7 is available. In the new version special field formats date, urldate, origdate, eventdate were added.

When you redefine the bibmacro date in the following way you can use such a definition:

\renewbibmacro*{date}{\printtext[date]{\printdate}}


The following example shows the result

\begin{filecontents}{bib.bib}
@book{book1,
Author = {Vorname Nachname},
Date = {1998},
Publisher = {Verlag},
Title = {Der Mythos},
urldate={2002-06-02}
}
@book{book2,
Author = {Hans Nachname},
Date = {2001-07-08},
Publisher = {Verlag},
Title = {Der Mythos},
urldate={2002-06-02}
}
\end{filecontents}
\documentclass[fontsize=12pt,ngerman]{scrartcl}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[backend=biber]{biblatex}
\DeclareFieldFormat{date}{\textbf{#1}}
\renewbibmacro*{date}{\printtext[date]{\printdate}}

@Joseph: It the same trick as for urldate. The command \DeclareFieldFormat{urldate}... exists in biblatex.def. So I looked to the definition and than I used it :-) – Marco Daniel Aug 14 '11 at 17:57