forked from DepthFrance/moment-ferie-fr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoment-ferie-fr.min.js
1 lines (1 loc) · 2.4 KB
/
moment-ferie-fr.min.js
1
(function(){"use strict";var n=function(n){n.fn.easterDay=n.fn.paques=function(e){void 0===e&&(e=this.year());var t=e%19,i=Math.floor(e/100),r=e%100,o=Math.floor(i/4),s=i%4,a=Math.floor((i+8)/25),f=Math.floor((i-a+1)/3),u=(19*t+i-o-f+15)%30,d=Math.floor(r/4),c=r%4,h=(32+2*s+2*d-u-c)%7,l=Math.floor((t+11*u+22*h)/451),Y=u+h+7*l+114,D=Math.floor(Y/31)-1,m=Y%31+1,y=new Date(e,D,m);return n(y)},n.fn.lundiDePaques=function(n){return void 0===n&&(n=this.year()),this.paques(n).add(1,"days")},n.fn.ascension=function(n){return void 0===n&&(n=this.year()),this.paques(n).add(39,"days")},n.fn.pentecote=function(n){return void 0===n&&(n=this.year()),this.paques(n).add(50,"days")},n.fn.jourDeLAn=function(e){return void 0===e&&(e=this.year()),n("1-1-"+e,"DD-MM-YYYY")},n.fn.feteDuTravail=function(e){return void 0===e&&(e=this.year()),n("1-5-"+e,"DD-MM-YYYY")},n.fn.victoireDeAllies=function(e){return void 0===e&&(e=this.year()),n("8-5-"+e,"DD-MM-YYYY")},n.fn.feteNationale=function(e){return void 0===e&&(e=this.year()),n("14-7-"+e,"DD-MM-YYYY")},n.fn.assomption=function(e){return void 0===e&&(e=this.year()),n("15-8-"+e,"DD-MM-YYYY")},n.fn.toussaint=function(e){return void 0===e&&(e=this.year()),n("1-11-"+e,"DD-MM-YYYY")},n.fn.armistice=function(e){return void 0===e&&(e=this.year()),n("11-11-"+e,"DD-MM-YYYY")},n.fn.noel=function(e){return void 0===e&&(e=this.year()),n("25-12-"+e,"DD-MM-YYYY")};var e={"Jour de l'an":n.fn.jourDeLAn,"Fête du travail":n.fn.feteDuTravail,"Victoire des alliés":n.fn.victoireDeAllies,"Fête Nationale":n.fn.feteNationale,Assomption:n.fn.assomption,Toussaint:n.fn.toussaint,Armistice:n.fn.armistice,"Noël":n.fn.noel,"Pâques":n.fn.paques,"Lundi de Pâques":n.fn.lundiDePaques,Ascension:n.fn.ascension,"Pentecôte":n.fn.pentecote};return n.fn.getFerieList=function(){var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push({name:t,date:e[t].call(this)});return n},n.fn.getFerie=function(){for(var n in e)if(e.hasOwnProperty(n)&&this.isSame(e[n].call(this)))return n;return null},n.fn.isFerie=function(){return null!==this.getFerie()},n.fn.isWeekEnd=function(){return 0===this.day()||6===this.day()},n.fn.isWorkingDay=function(){return!this.isWeekEnd()&&!this.isFerie()},n};"function"==typeof define&&define.amd?define("moment-ferie-fr",["moment"],function(e){return this.moment=n(e)}):"undefined"!=typeof module?module.exports=n(require("moment")):"undefined"!=typeof window&&window.moment&&(this.moment=n(this.moment))}).call(this);