Putting a timeline for dates in moderncv

For the record, I have adapted Jake's code and began working on a new package called moderntimeline:

\usepackage{moderntimeline}

% Set the scale.
% I go up to 2013 otherwise some late dates overflow on the entry
\tlmaxdates{1999}{2013}
% Set the line width.
% This automatically sets the space under the top label to be 1pt more
\tlwidth{0.8ex}
% Set the labels text size
\tltext{\tiny}

And then a few examples:

\section{Experience}
\subsection{IT Experience}
\tlcventry[blue]{2006}{0}{Systems Engineer}{\href{http://www.orness.com}{ORNESS} then \href{http://www.alten.fr}{Alten}}{Sophia Antipolis}{}
{Consultant at France T\'el\'ecom
\begin{itemize}
 \item Administration of Cfengine, FAI and the software package repository;
 \item Renewal and industrialization of the software deployment system for Debian/Ubuntu;
 \item Management of the Gforge (collaborative development web interface) platform;
 \item Monitoring of the fleet of servers;
 \item Writing of technical documentation.
\end{itemize}}

tl1

\tllabelcventry[purple]{1999}{2000}{1999--2000}{Paramedic}
  {\href{http://www.croix-rouge.fr/}{French Red Cross}}{Paris Suburbs}{}
  {Served in several volunteer missions as a paramedic}

tl2

\tldatelabelcventry[red]{2004}{July 2004}{Blue Collar Internship}
  {\href{http://www.snecma.com}{SNECMA}}{Moissy-Cramayel}{}
  {Assembled and equilibrated turbo reactors for planes}

tl3

\tldatecventry[green]{2005}{Student in Pedagogy (`Gestion Mentale')}
  {\href{http://www.ifgm.org/}{IFGM}}{Bordeaux}{}
  {Pedagogy, Didacticism, Cognitive Psychology}

tl4

Edit: Since moderncv aligns the left column to the right, there were weird things with dates, so I decided to put a white rectangle all over each entry to make sure the whole space was used. After that, my wife suggested I used a thin line to every entry to make things clearer, so now it looks like this (color and width of the thin line can be set):

tl5

Full examples can be seen in my updated CV.


This code doesn't work with versions of moderncv after 2012. Please use ℝaphink's moderntimeline package instead

Here's a way of getting this to work with moderncv. I've defined a new macro, \funkycventry that takes the start and end year and then all the same arguments as cventry, and uses this to draw the timeline bar in the same colour and width as the section headers. If the end year is 0, the bar fades out, and no end year is printed.

\documentclass[]{moderncv}
\usepackage{tikz}
\moderncvtheme[blue]{casual}

\usepackage[scale=0.8]{geometry}
\firstname{John}
\familyname{Doe}


\begin{document}
\maketitle

\tikzset{
    startyear/.style={
        font=\scriptsize,
        name=startyear,
        above=3pt,
        inner xsep=0pt,
        anchor=base west,
    },
    endyear/.style={
        font=\scriptsize,
        name=endyear,
        below,
        inner xsep=0pt,
        anchor=north east,
    }
}

\def\firstyear{2000}
\def\lastyear{2011}
\pgfmathsetmacro\yearrange{\lastyear-\firstyear}

\newcommand{\funkycventry}[7]{%
\pgfmathsetmacro\endyear{ifthenelse(#2==0,\lastyear,#2)}
\pgfmathsetmacro\startfraction{(#1-\firstyear)/(\lastyear-\firstyear)}%
\pgfmathsetmacro\endfraction{(\endyear-\firstyear)/(\lastyear-\firstyear)}%
\pgfmathsetmacro\ongoing{!(#2==0)}
 \cventry{\tikz[baseline=(endyear.north)]{
    \fill [sectionrectanglecolor] (0,0) 
        ++(\startfraction*\hintscolumnwidth,0pt)
        node [startyear] {#1}
        rectangle (\endfraction*\hintscolumnwidth,0.5ex)
        node [endyear] {\pgfmathparse{ifthenelse(#2==0,,#2)}\pgfmathresult}
        (\hintscolumnwidth,0pt) ;
    \ifnum #2=0
        \shade [left color=sectionrectanglecolor]
        (\endfraction*\hintscolumnwidth-1em,0pt) rectangle ++(1em,0.5ex);
    \fi}
}
{#3}{#4}{#5}{#6}{#7}
}

\section{Experience}
\subsection{Vocational}
\funkycventry{2002}{2007}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\item Achievement 3.
\end{itemize}}
\funkycventry{2000}{2011}{Job title}{Employer}{City}{}{Description line 1\newline{}Description line 2}
\subsection{Miscellaneous}
\funkycventry{2005}{0}{Job title}{Employer}{City}{}{Description}


\end{document}

If I understood your description correctly, this could be what you need:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}[ultra thick]
\def\timelineunfinished#1#2{\node (refnode) at (0,0) {};%
                   \shade [left color=#1,right color=white] (${#2-2000}*(1,0)$) rectangle ++(${2011-#2}*(1,0)+1*(0,-0.5)$) node [pos=0, label=#2] (startdate) {};}

\timelineunfinished{red}{2005}
\end{tikzpicture}

\begin{tikzpicture}
\def\timelinefinished#1#2#3{\node (refnode) at (0,0) {};%
                   \path [fill=#1] (${#2-2000}*(1,0)$) rectangle ++(${#3-#2}*(1,0)+1*(0,-0.5)$) node [pos=0, label=#2] (startdate) {} node [label=#3] (enddate) at ++(0,0.5) {};}

\timelinefinished{red}{2003}{2007}
\end{tikzpicture}
\end{document}

What I did, is define two new commands, one for timelines that have a start and an end date (these will not be rendered with gradient, but with solid fill) and one for the timelines that are 'in progress'. The timelines can start at 2000 earliest and end at latest in 2011. To change the limits, just replace the numbers in the code accordingly.

The code can probably be cleaned up, error checking could be included to avoid having the end earlier than the start, etc. But for a primer I hope this will do.