From c97feb2c83c5143fba41f5004466288bf19b4744 Mon Sep 17 00:00:00 2001 From: KANE LAZENI Date: Sat, 3 Jan 2026 09:33:14 +0000 Subject: [PATCH] a --- Js/fonctions.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/Js/fonctions.js b/Js/fonctions.js index 2a8d9f8..1c8e067 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -1568,3 +1568,52 @@ function controle_date_avenant() $("#dateAvenant").readable(); $("#motifavenant").readable(); } + +$.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; +};