1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
   | private int get_NbreJourOuvrable(){
           // Date date_Ouv = (Date)Date.fromText(dat_Debut, "dd/mm/yyyy", "");
           // Date date_Fin = (Date)Date.fromText(dat_Fin, "dd/mm/yyyy", "");
         //   int count = 0;
            new Thread(new Runnable(){
                public void run(){
                    Date date_Ouv = (Date)Date.fromText("01/01/2002", "dd/mm/yyyy", "");
                    Date date_Fin = (Date)Date.fromText("18/02/2009", "dd/mm/yyyy", "");                    
                    if (date_Ouv.compareTo(date_Fin) > 0) {
                        count = -1;            
                    }
                    while (date_Ouv.compareTo(date_Fin) <= 0) {
                        if (!mDBaccess.EstJourFerie(date_Ouv) && !mDBaccess.EstJourWeekEnd(date_Ouv)) {
                                count++; 
                                date_Ouv = mDBaccess.AjouterJoursADate(date_Ouv, 1);                        
                        } else  date_Ouv = mDBaccess.JourOuvrableApres(date_Ouv);               
                    }
System.out.println(" count :" + count);
                }
}
            ).start();
            
            return count;
    } | 
Partager