jours ferriés

Forum destiné aux questions sur le développement : Formules, LotusScript, Java ...

jours ferriés

Messagepar asx9 » 02 Juil 2003 à 11:45

comment je peux détecter les jours ferriés?j'ai une variable "jour" telle que: Set jour = New NotesDateTime (Datenumber(Year(dateDJ.LSLocalTime),Month(dateDJ.LSLocalTime),Day(dateDJ.LSLocalTime)))et dateDJ telle que: Set dateDJ = New notesdatetime (Format$(doc.getitemvalue("Datedemande")(0),"dd/mm/yyyy"))j'aimerai savoir si "jour" correspond au 25/12 ou 15/08...
asx9
 

Re: jours ferriés

Messagepar Stef » 02 Juil 2003 à 13:42

Function IsFerie(UneDate As notesdatetime) As String Dim A As Integer Dim b As Integer Dim c As Integer Dim d As Integer Dim e As Integer Dim f As Integer Dim g As Integer Dim h As Integer Dim i As Integer Dim k As Integer Dim q As Integer Dim m As Integer Dim n As Integer Dim p As Integer Dim Z As Integer Dim Paques As notesDatetime Dim LundiPaques As notesDatetime Dim Ascension As notesDatetime Dim LundiPentecote As notesDatetime Dim Pentecote As notesDatetime Z = Year(UneDate.DateOnly) 'annéeA = Z Mod 19b = Int(Z / 100)c = Z Mod 100d = Int(b / 4)e = b Mod 4f = Int((b + 9) / 25)g = Int((b - f + 1) / 3)h = (19 * A + b - d - g + 15) Mod 30i = Int(c / 4)k = c Mod 4q = (32 + 2 * e + 2 * i - h - k) Mod 7m = Int((A + 11 * h + 22 * q) / 451)n = Int((h + q - 7 * m + 114) / 31) 'jourp = (h + q - 7 * m + 114) Mod 31 'moisSet NouvelAn = New notesdatetime(Dateserial(Z, 1,1))Set FeteNationale = New notesdatetime(Dateserial(Z, 7, 14))Set FeteTravail = New notesdatetime(Dateserial(Z, 5,1))Set Victoire1945 = New notesdatetime(Dateserial(Z, 5,8))Set Assomption = New notesdatetime(Dateserial(Z, 8,1))Set Toussaint = New notesdatetime(Dateserial(Z, 11,1))Set Armistice1918 = New notesdatetime(Dateserial(Z, 11,11))Set Noel = New notesdatetime(Dateserial(Z, 12,25))Set JourPaques = New notesdatetime(Dateserial(Z, n, p + 1)) Set Paques = New notesdatetime(JourPaques.dateonly)Call Paques.AdjustDay(1)Set LundiPaques = Paques Set Paques = New notesdatetime(JourPaques.dateonly)Call Paques.AdjustDay(39)Set Ascension = Paques Set Paques = New notesdatetime(JourPaques.dateonly)Call Paques.AdjustDay(49)Set Pentecote = Paques Set Paques = New notesdatetime(JourPaques.dateonly)Call Paques.AdjustDay(50)Set LundiPentecote = Paques If UneDate.DateOnly = Paques.DateOnly Then IsFerie = "Paques"Else IsFerie = "" If UneDate.DateOnly = LundiPaques.DateOnly Then IsFerie = "Lundi de Paques"Else IsFerie = "" If UneDate.DateOnly = Ascension.Dateonly Then IsFerie = "Ascension" Else IsFerie = "" If UneDate.DateOnly = Pentecote.DateOnly Then IsFerie = "Pentecote" Else IsFerie = "" If UneDate.DateOnly = LundiPentecote.DateOnly Then IsFerie = "Lundi de Pentecote" Else IsFerie = "" If UneDate.DateOnly = Dateserial(Z, 7, 14) Then IsFerie = "Fete Nationnale" Else IsFerie = "" If UneDate.DateOnly = Dateserial(Z, 5, 1) Then IsFerie = "Fete du travail" Else IsFerie = "" If UneDate.DateOnly = Victoire1945.Dateonly Then IsFerie = "Victoire 1945" Else IsFerie = "" If UneDate.DateOnly = Armistice1918.dateOnly Then IsFerie = "Armistice 1918" Else IsFerie = "" If UneDate.DateOnly = Assomption.dateonly Then IsFerie = "Assomption" Else IsFerie = "" If UneDate.DateOnly = Toussaint.Dateonly Then IsFerie = "Toussaint" Else IsFerie = "" If UneDate.DateOnly = Noel.Dateonly Then IsFerie = "Noel" Else IsFerie = "" If UneDate.DateOnly = NouvelAn.DateOnly Then IsFerie = "Nouvel an" Else IsFerie = "" End If End If End If End If End If End If End If End If End If End If End If End If End If End Function
Stef
 

Re: jours ferriés

Messagepar Stef » 02 Juil 2003 à 13:43

j'ai pas eu le temps d'ecrire un mot,c une fonction que j'utilise et qui fonctionne .J'espere que c cela que tu cherches.
Stef
 

Re: jours ferriés

Messagepar asx9 » 02 Juil 2003 à 14:02

oui c tout à fait ce que je recherchais, merci.
asx9
 


Retour vers Développement