ss-total remun
[auf_rh_dae.git] / project / media / js / dae.js
CommitLineData
f87fe1a1
OL
1/* string to float */
2function clean_float(value){
57bd966c 3 if (isNaN(value) || value == undefined || value == "") {
f87fe1a1 4 output = 0;
57bd966c
OL
5 }
6 else {
f87fe1a1
OL
7 output = parseFloat(value);
8 output = Math.round(output*100)/100;
57bd966c 9 }
d1ca1d61 10 return parseInt(output);
f87fe1a1 11}
72db8238
OL
12
13/* stocker le texte par défaut à afficher */
14var note_duree_indeterminee = "";
15
16function contrat_mois() {
17 if (note_duree_indeterminee == "")
18 note_duree_indeterminee = $("#note-duree").html();
19 var debut = $("#id_date_debut, #id_contrat_date_debut").val();
20 var fin = $("#id_date_fin, #id_contrat_date_fin").val();
21 if (debut == "" || fin == "")
22 note = note_duree_indeterminee;
23 else {
24 var d1 = new Date(debut);
25 var d2 = new Date(fin);
26 var duree = Math.round((d2-d1) / (1000*60*60*24) / (365/12));
27 note = duree + " mois";
28 }
29 $("#note-duree").html(note);
30}
31