
function yymmddToText(yymmdd) {
    var months = [ "janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "aout", "septembre", "octobre", "novembre", "decembre" ];
    return '' +parseInt(yymmdd.substr(4, 2), 10) +' ' +months[parseInt(yymmdd.substr(2, 2), 10)] +' 20' +yymmdd.substr(0, 2);
}

/**
 * @param {*} gridObj
 * @return {Element}
**/
function makeGridListItem(gridObj) {
    var dom = dCreate("li")
        ,link = dCreate("a")
        ,difficulty = dCreate("span")
        ,provider = dCreate("span")
        ,day = dCreate("span");

    dom.className = R.klass.grid.item +' ' +R.klass.grid.type.crossword;
    link.href = "api/create?gridProvider=" +gridObj["providerId"] +"&gridId=" +gridObj["id"];

    difficulty.className = R.klass.grid.level;
    difficulty.textContent = gridObj["level"];
    link.appendChild(difficulty);

    provider.className = R.klass.grid.provider;
    provider.textContent = gridObj["provider"];
    link.appendChild(provider);

    day.className = R.klass.grid.date;
    day.textContent = yymmddToText('' +gridObj["date"]);
    link.appendChild(day);

    dom.appendChild(link);
    return dom;
};

