How to format the extrayear field in biblatex

In author-year citation/bibliography styles, multiple publications by the same author in the same year are formatted with a lowercase letter after the year: Smith 2011a ... Smith 2011b etc.

In biblatex this works fine with numeric dates, but fails with non-numeric dates like "in progress". (The natbib style I use handles these cases correctly by putting parentheses around the letter if the year field is non-numeric.) How do I do the same thing in biblatex? So the expected output is:

Smith, 2011a Smith, 2011b

Smith, in progress(a) Smith, in progress(b)

Sample file and output:

\documentclass{article}
\usepackage[style=authoryear,labelyear=true]{biblatex}
\usepackage{filecontents}
\bibliography{test}
\begin{document}
\cite{test1,test2}
\printbibliography
\begin{filecontents}{test.bib}
@unpublished{test1,
Author = {John Smith},
Date-Modified = {2011-02-21 13:42:02 -0500},
Note = {ms. MSU},
Title = {A great paper in progress},
Year = {in progress}}

@unpublished{test2,
Author = {John Smith},
Date-Modified = {2011-02-21 13:42:46 -0500},
Note = {ms. MSU},
Title = {Another great paper in progress},
Year = {in progress}}
\end{filecontents}
\end{document}


-
Good question. :-) Note that you don't need to set labelyear=true, as this is the default for the authoryear style. –  lockstep Feb 21 '11 at 19:16
@lockstep So it is. I wonder if it was always so; as biblatex evolved, my code probably hasn't. –  Alan Munn Feb 21 '11 at 19:19

This is a somewhat cruel hack, but here we go. Add the following to your preamble (EDIT: Should have scanned the manual more thoroughly -- \iffieldnums seems to be the correct test, see p. 148--149):

\DeclareFieldFormat{extrayear}{%
\iffieldnums{labelyear}{%
\mknumalph{#1}%
}{%
\mkbibparens{\mknumalph{#1}}%
}%
}


UPDATE: I have submitted a feature request at SourceForge.net: biblatex.

UPDATE: The feature request is now pending. Philipp Lehman, author of biblatex, commented:

I'll add that even though I'm not entirely convinced that this is the way to deal with work in progress. I'd rather recommend putting "in progress" in the "pubstate" field and set a label in the "label" field.

UPDATE: This feature has been implemented in biblatex v1.3 (released March 14th, 2011).

-
Thanks! Why do you think this is a cruel hack? (It probably should be the default, but that's another issue.) Or was your cruel hack before you read the manual and edited your answer? –  Alan Munn Feb 21 '11 at 20:06
@Alan: Exactly. –  lockstep Feb 21 '11 at 20:07
@Alan: If my solution shapes up as robust, I will submit a feature request at sourceforge.biblatex. The current state can only be an oversight. –  lockstep Feb 21 '11 at 20:09