This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converti le string en date JS | |
* @param {string} d date au format DD/MM/YYYY | |
* @returns {Date} | |
*/ | |
function stringToDate(d){ | |
// console.log(d); | |
let d_ = d.split('/'); | |
// console.log(d + ' ' + (parseInt(d_[1])-1)); | |
return new Date(Date.UTC(d_[2],(parseInt(d_[1])-1),d_[0],0,0,0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Coupe le texte 'data' dont la longueur dépasse 'lng_max' | |
* @param {string} data Texte à couper | |
* @param {number} lng_max Longueur maximale | |
*/ | |
function couperTexte (data, lng_max=37) { | |
return data.length > lng_max ? | |
'<span title="'+data+'">'+data.substr( 0, (lng_max - 3) )+'...</span>' : | |
data; | |
} |