# Change date format in biblatex

This question is the third in the series of questions on how to tweak the defaults of biblatex to comply with traditional Norwegian (Move editor name in biblatex bibliography, Treat author of "inbook" entry as editor of "incollection" entry in biblatex), but this question is still independent of my previous questions.

Traditional Norwegian doesn't use the Latin names for the months, but uses an ordinal instead (Change month names in \today command). When these ordinals are abbreviated in date expressions, we just use the number. As an example, "i fyrste" (for 'January') is abbreviated to "1".

In the following MWE, then, the desired outcome would be

4-9/9/1961

and not the actually produced

4.-9. sep. 1961

Since the desired string does more than just putting in another word for sep., a fancier solution is needed than one that just sets \DefineBibliographyStrings{nynorsk}{september={<string>}}

\documentclass{article}

\usepackage[backend=biber,
style = authoryear-comp,
language = nynorsk,
sortlocale = nn_NO]{biblatex}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}

\DefineBibliographyStrings{nynorsk}{
references = {Tilvisingar}}

\begin{filecontents*}{\jobname.bib}
@PROCEEDINGS{aalto1962,
EDITOR = "Antti Sovij{\"a}rvi and Pentti Aalto",
TITLE = "Proceedings of the fourth international congress of phonetic sciences",
YEAR = "1962",
EVENTDATE = "1961-09-04/1961-09-09",
LOCATION = "The Hague",
NUMBER = "10",
PUBLISHER = "Mouton \& Co",
SERIES = "Janua linguarum. Studia memoriae Nicolai van Wijk dedicata. Series maior",
VENUE = "University of Helsinki"}
\end{filecontents*}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


By default biblatex formats most dates in the comp format, which uses long month names and compressed ranges. For full numeric dates, terse is the right choice. The language settings from the MWE would then produce

For the exact desired format, \mkbibdateshort needs to be redefined.

\documentclass{article}

\usepackage[backend=biber,
style = authoryear-comp,
alldates=terse, labeldate=year,
language = nynorsk,
sortlocale = nn_NO]{biblatex}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}

\DefineBibliographyExtras{norsk}{%
\protected\def\mkbibdateshort#1#2#3{%
\iffieldundef{#3}
{}
{\thefield{#3}%
\iffieldundef{#2}{}{\slash}}%
\iffieldundef{#2}
{}
{\thefield{#2}%
\iffieldundef{#1}{}{\slash}}%
\iffieldbibstring{#1}
{\bibstring{\thefield{#1}}}
{\dateeraprintpre{#1}\mkyearzeros{\thefield{#1}}}}%
}

\DefineBibliographyStrings{nynorsk}{
references = {Tilvisingar}}

\begin{filecontents*}{\jobname.bib}
@PROCEEDINGS{aalto1962,
EDITOR = "Antti Sovij{\"a}rvi and Pentti Aalto",
TITLE = "Proceedings of the fourth international congress of phonetic sciences",
YEAR = "1962",
EVENTDATE = "1961-09-04/1961-09-09",
LOCATION = "The Hague",
NUMBER = "10",
PUBLISHER = "Mouton \& Co",
SERIES = "Janua linguarum. Studia memoriae Nicolai van Wijk dedicata. Series maior",
VENUE = "University of Helsinki"}
\end{filecontents*}