From 1196e8fa9ceddc247a056100daf818ccf0a44d51 Mon Sep 17 00:00:00 2001 From: KANE LAZENI Date: Sun, 4 Jan 2026 13:56:20 +0000 Subject: [PATCH] a --- Js/fonctions.js | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/Js/fonctions.js b/Js/fonctions.js index 762e634..e56b841 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -2416,3 +2416,61 @@ function prorater_prime_beneficiaire() }); } + + +$.prototype.enable = function () { + $.each(this, function (index, el) { + $(el).removeAttr('disabled'); + }); +} + +$.prototype.disable = function () { + $.each(this, function (index, el) { + $(el).attr('disabled', 'disabled'); + }); +} + +$.prototype.unreadable = function () { + $.each(this, function (index, el) { + $(el).attr('READONLY', 'READONLY'); + }); +} + +$.prototype.readable = function () { + $.each(this, function (index, el) { + $(el).removeAttr('READONLY'); + }); +} + +Date.estAnneeBissextile = function (annee) { + return (((annee % 4 === 0) && (annee % 100 !== 0)) || (annee % 400 === 0)); +}; + +Date.getDaysInMonth = function (annee, month) { + return [31, (Date.estAnneeBissextile(annee) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; +}; + +Date.prototype.estAnneeBissextile = function () { + return Date.estAnneeBissextile(this.getFullYear()); +}; + +Date.prototype.getDaysInMonth = function () { + return Date.getDaysInMonth(this.getFullYear(), this.getMonth()); +}; + +Date.prototype.addMonths = function (value) { + var n = this.getDate(); + this.setDate(1); + this.setMonth(this.getMonth() + value); + this.setDate(Math.min(n, this.getDaysInMonth())); + this.setDate(this.getDate()-1); + return this; +}; + +$( ".datepicker" ).datepicker({ + inline: true, + changeMonth: true, + changeYear: true, + yearRange: "c-60:c+20" + +}); \ No newline at end of file