{"id":91,"date":"2025-12-31T16:06:09","date_gmt":"2025-12-31T16:06:09","guid":{"rendered":"https:\/\/www.aivb-web.fr\/?page_id=91"},"modified":"2026-01-13T12:15:09","modified_gmt":"2026-01-13T12:15:09","slug":"convertisseur-date-hebraique-gregorien","status":"publish","type":"page","link":"https:\/\/www.aivb-web.fr\/index.php\/convertisseur-date-hebraique-gregorien\/","title":{"rendered":"Calendrier"},"content":{"rendered":"\n<div class=\"hebcal-widget-instance hebcal-widget\">\n  <div class=\"hebcal-topbar\">\n    <h2 class=\"hebcal-title\">Convertisseur de dates &#8211; Gregorien <span aria-hidden=\"true\">\u2194<\/span> Hebraique<\/h2>\n    <span class=\"hebcal-badge\">Local (sans API)<\/span>\n  <\/div>\n\n  <div class=\"hebcal-card\">\n    <div class=\"hebcal-grid\">\n      <section class=\"hebcal-panel\">\n        <h3 class=\"hebcal-h3\">Gregorien \u2192 Hebraique<\/h3>\n\n        <label class=\"hebcal-label\">Date gregorienne<\/label>\n        <input class=\"hebcal-input\" data-hebcal=\"gdate\" type=\"date\" \/>\n\n        <div class=\"hebcal-actions\">\n          <button type=\"button\" class=\"hebcal-btn\" data-hebcal=\"btnG2H\">Convertir<\/button>\n          <button type=\"button\" class=\"hebcal-btn secondary\" data-hebcal=\"btnToday\">Aujourdhui<\/button>\n        <\/div>\n\n        <div class=\"hebcal-out\" data-hebcal=\"outG2H\" aria-live=\"polite\">\n          <div class=\"hebcal-muted\">Choisis une date puis clique sur &#8220;Convertir&#8221;.<\/div>\n        <\/div>\n\n        <div class=\"hebcal-hint\">\n          Note : conversion en jour civil (minuit &#8211; minuit). Le jour hebraique change au coucher du soleil.\n        <\/div>\n      <\/section>\n\n      <section class=\"hebcal-panel\">\n        <h3 class=\"hebcal-h3\">Hebraique \u2192 Gregorien<\/h3>\n\n        <div class=\"hebcal-row\">\n          <div>\n            <label class=\"hebcal-label\">Jour<\/label>\n            <input class=\"hebcal-input\" data-hebcal=\"hDay\" type=\"number\" min=\"1\" max=\"30\" value=\"1\" \/>\n          <\/div>\n          <div>\n            <label class=\"hebcal-label\">Mois<\/label>\n            <select class=\"hebcal-input\" data-hebcal=\"hMonth\"><\/select>\n          <\/div>\n          <div>\n            <label class=\"hebcal-label\">Annee<\/label>\n            <input class=\"hebcal-input\" data-hebcal=\"hYear\" type=\"number\" min=\"1\" step=\"1\" \/>\n          <\/div>\n        <\/div>\n\n        <div class=\"hebcal-actions\">\n          <button type=\"button\" class=\"hebcal-btn\" data-hebcal=\"btnH2G\">Convertir<\/button>\n          <button type=\"button\" class=\"hebcal-btn secondary\" data-hebcal=\"btnAutoYear\">Annee auto<\/button>\n        <\/div>\n\n        <div class=\"hebcal-out\" data-hebcal=\"outH2G\" aria-live=\"polite\">\n          <div class=\"hebcal-muted\">Renseigne une date hebraique puis clique sur &#8220;Convertir&#8221;.<\/div>\n        <\/div>\n      <\/section>\n    <\/div>\n\n    <hr class=\"hebcal-divider\" \/>\n\n    <details class=\"hebcal-details\" open>\n      <summary><strong>Details techniques<\/strong> (debug)<\/summary>\n      <pre class=\"hebcal-pre\" data-hebcal=\"details\">Pret.<\/pre>\n    <\/details>\n  <\/div>\n<\/div>\n\n<style>\n  .hebcal-widget{ font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif; }\n  .hebcal-topbar{ display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin-bottom:10px; }\n  .hebcal-title{ margin:0; font-size:1.25rem; }\n  .hebcal-badge{ font-size:.85rem; padding:6px 10px; border-radius:999px; background: rgba(127,127,127,.12); }\n\n  .hebcal-card{ border:1px solid rgba(127,127,127,.35); border-radius:16px; padding:16px; }\n  .hebcal-grid{ display:grid; gap:12px; grid-template-columns: 1fr; }\n  @media (min-width: 900px){ .hebcal-grid{ grid-template-columns: 1fr 1fr; } }\n\n  .hebcal-panel{ border:1px solid rgba(127,127,127,.28); border-radius:14px; padding:12px; }\n  .hebcal-h3{ margin:0 0 8px; font-size:1.05rem; }\n  .hebcal-label{ display:block; font-weight:650; margin:10px 0 6px; }\n  .hebcal-input{ width:100%; box-sizing:border-box; padding:10px 12px; border-radius:10px; border:1px solid rgba(127,127,127,.35); background:transparent; }\n\n  .hebcal-row{ display:flex; gap:10px; flex-wrap:wrap; align-items:end; }\n  .hebcal-row > div{ flex:1; min-width:160px; }\n\n  .hebcal-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }\n  .hebcal-btn{ padding:10px 14px; border-radius:10px; border:0; cursor:pointer; font-weight:800; background: rgba(80,160,255,.35); }\n  .hebcal-btn.secondary{ background: rgba(127,127,127,.16); }\n\n  .hebcal-out{ margin-top:14px; padding:12px; border-radius:12px; background: rgba(127,127,127,.10); }\n  .hebcal-muted{ opacity:.78; font-size:.93rem; line-height:1.35; }\n  .hebcal-hint{ font-size:.9rem; opacity:.78; margin-top:6px; }\n  .hebcal-divider{ margin:14px 0; border:0; border-top:1px solid rgba(127,127,127,.25); }\n  .hebcal-pre{ margin:10px 0 0; padding:10px; border-radius:10px; background: rgba(127,127,127,.08); overflow:auto; }\n  .hebcal-ok{ font-weight:800; }\n  .hebcal-err{ font-weight:800; color:#c0392b; }\n<\/style>\n\n<script>\n(function () {\n  \"use strict\";\n\n  function initOne(root) {\n    if (!root || root.getAttribute(\"data-hcw-init\") === \"1\") return;\n    root.setAttribute(\"data-hcw-init\", \"1\");\n\n    function q(name) {\n      return root.querySelector('[data-hebcal=\"' + name + '\"]');\n    }\n\n    var outG2H = q(\"outG2H\");\n    var outH2G = q(\"outH2G\");\n    var detailsEl = q(\"details\");\n\n    function showError(el, msg) {\n      if (!el) return;\n      el.innerHTML = '<div class=\"hebcal-err\">Erreur : ' + msg + '<\/div>';\n    }\n    function showOk(el, html) {\n      if (!el) return;\n      el.innerHTML = html;\n    }\n    function renderDetails(txt) {\n      if (!detailsEl) return;\n      detailsEl.textContent = txt;\n    }\n\n    \/\/ check required\n    var required = [\"gdate\",\"btnG2H\",\"btnToday\",\"outG2H\",\"hDay\",\"hMonth\",\"hYear\",\"btnH2G\",\"btnAutoYear\",\"outH2G\",\"details\"];\n    var i;\n    for (i = 0; i < required.length; i++) {\n      if (!q(required[i])) {\n        showError(outG2H, \"Element manquant: \" + required[i]);\n        return;\n      }\n    }\n\n    \/\/ Gregorian -> JD (noon)\n    function gregorianToJD(year, month, day) {\n      var a = Math.floor((14 - month) \/ 12);\n      var y = year + 4800 - a;\n      var m = month + 12 * a - 3;\n      var jdn = day + Math.floor((153 * m + 2) \/ 5) + 365 * y + Math.floor(y \/ 4)\n              - Math.floor(y \/ 100) + Math.floor(y \/ 400) - 32045;\n      return jdn - 0.5;\n    }\n    function jdToGregorian(jd) {\n      var jdn = Math.floor(jd + 0.5);\n      var a = jdn + 32044;\n      var b = Math.floor((4 * a + 3) \/ 146097);\n      var c = a - Math.floor(146097 * b \/ 4);\n      var d = Math.floor((4 * c + 3) \/ 1461);\n      var e = c - Math.floor(1461 * d \/ 4);\n      var mm = Math.floor((5 * e + 2) \/ 153);\n      var day = e - Math.floor((153 * mm + 2) \/ 5) + 1;\n      var month = mm + 3 - 12 * Math.floor(mm \/ 10);\n      var year = 100 * b + d - 4800 + Math.floor(mm \/ 10);\n      return { year: year, month: month, day: day };\n    }\n    function pad2(n) { return (n < 10 ? \"0\" : \"\") + n; }\n    function isoFromYMD(y, m, d) { return y + \"-\" + pad2(m) + \"-\" + pad2(d); }\n\n    \/\/ Hebrew calendar (reference-style)\n    var HEBREW_EPOCH = 347995.5;\n    function mod(a, b) { var r = a % b; return r < 0 ? r + b : r; }\n    function hebrewLeap(year) { return mod(7 * year + 1, 19) < 7; }\n    function hebrewYearMonths(year) { return hebrewLeap(year) ? 13 : 12; }\n\n    function hebrewDelay1(year) {\n      var months = Math.floor((235 * year - 234) \/ 19);\n      var parts = 12084 + 13753 * months;\n      var day = months * 29 + Math.floor(parts \/ 25920);\n      return (mod(3 * (day + 1), 7) < 3) ? day + 1 : day;\n    }\n    function hebrewDelay2(year) {\n      var last = hebrewDelay1(year - 1);\n      var present = hebrewDelay1(year);\n      var next = hebrewDelay1(year + 1);\n      if (next - present === 356) return 2;\n      if (present - last === 382) return 1;\n      return 0;\n    }\n\n    function hebrewYearDays(year) {\n      return hebrewToJD(year + 1, 7, 1) - hebrewToJD(year, 7, 1);\n    }\n    function longHeshvan(year) { return mod(hebrewYearDays(year), 10) === 5; }\n    function shortKislev(year) { return mod(hebrewYearDays(year), 10) === 3; }\n\n\nfunction hebrewMonthDays(year, month) {\n  if (month === 2 || month === 4 || month === 6 || month === 10 || month === 13) return 29;\n\n  \/\/ au lieu de: (month === 12 &#038;&#038; !hebrewLeap(year))\n  if (month === 12) {\n    if (!hebrewLeap(year)) return 29;\n  }\n\n  \/\/ au lieu de: (month === 8 &#038;&#038; !longHeshvan(year))\n  if (month === 8) {\n    if (!longHeshvan(year)) return 29;\n  }\n\n  \/\/ au lieu de: (month === 9 &#038;&#038; shortKislev(year))\n  if (month === 9) {\n    if (shortKislev(year)) return 29;\n  }\n\n  return 30;\n}\n\n    function hebrewToJD(year, month, day) {\n      var monthsInYear = hebrewYearMonths(year);\n      var jd = HEBREW_EPOCH + hebrewDelay1(year) + hebrewDelay2(year) + day + 1;\n\n      var m;\n      if (month < 7) {\n        for (m = 7; m <= monthsInYear; m++) jd += hebrewMonthDays(year, m);\n        for (m = 1; m < month; m++) jd += hebrewMonthDays(year, m);\n      } else {\n        for (m = 7; m < month; m++) jd += hebrewMonthDays(year, m);\n      }\n      return jd;\n    }\n\n    function jdToHebrew(jd) {\n      jd = Math.floor(jd) + 0.5;\n\n      var count = Math.floor(((jd - HEBREW_EPOCH) * 98496.0) \/ 35975351.0);\n      var year = count - 1;\n      var i2;\n\n      for (i2 = count; jd >= hebrewToJD(i2, 7, 1); i2++) year++;\n\n      var first = (jd < hebrewToJD(year, 1, 1)) ? 7 : 1;\n      var month = first;\n\n      for (i2 = first; jd > hebrewToJD(year, i2, hebrewMonthDays(year, i2)); i2++) month++;\n\n      var day = (jd - hebrewToJD(year, month, 1)) + 1;\n      return { year: year, month: month, day: day };\n    }\n\n    function hebrewMonthNameFR(year, month) {\n      var leap = hebrewLeap(year);\n      if (month === 1) return \"Nisan\";\n      if (month === 2) return \"Iyar\";\n      if (month === 3) return \"Sivan\";\n      if (month === 4) return \"Tammouz\";\n      if (month === 5) return \"Av\";\n      if (month === 6) return \"Eloul\";\n      if (month === 7) return \"Tishri\";\n      if (month === 8) return \"Heshvan\";\n      if (month === 9) return \"Kislev\";\n      if (month === 10) return \"Tevet\";\n      if (month === 11) return \"Shevat\";\n      if (month === 12) return leap ? \"Adar I\" : \"Adar\";\n      if (month === 13) return \"Adar II\";\n      return \"Mois \" + month;\n    }\n\n    function setToday() {\n      var now = new Date();\n      q(\"gdate\").value = isoFromYMD(now.getFullYear(), now.getMonth() + 1, now.getDate());\n    }\n    function currentHebrewYearFromToday() {\n      var now = new Date();\n      var jd = gregorianToJD(now.getFullYear(), now.getMonth() + 1, now.getDate());\n      return jdToHebrew(jd).year;\n    }\n    function populateHebrewMonths(year) {\n      var select = q(\"hMonth\");\n      var keep = Number(select.value || 7);\n      select.innerHTML = \"\";\n\n      var months = hebrewYearMonths(year);\n      var order = [];\n      var m;\n      for (m = 7; m <= months; m++) order.push(m);\n      for (m = 1; m <= 6; m++) order.push(m);\n\n      for (m = 0; m < order.length; m++) {\n        var mm = order[m];\n        var opt = document.createElement(\"option\");\n        opt.value = String(mm);\n        opt.textContent = hebrewMonthNameFR(year, mm);\n        select.appendChild(opt);\n      }\n\n      \/\/ restore\n      var found = false;\n      for (m = 0; m < select.options.length; m++) {\n        if (Number(select.options[m].value) === keep) found = true;\n      }\n      select.value = found ? String(keep) : \"7\";\n    }\n\n    function validateHebrewInput(year, month, day) {\n      if (!isFinite(year) || year < 1) return \"Annee hebraique invalide.\";\n      var maxMonth = hebrewYearMonths(year);\n      if (!isFinite(month) || month < 1 || month > maxMonth) return \"Mois hors limite (1..\" + maxMonth + \").\";\n      var maxDay = hebrewMonthDays(year, month);\n      if (!isFinite(day) || day < 1 || day > maxDay) return \"Jour hors limite (1..\" + maxDay + \").\";\n      return null;\n    }\n\n    function handleG2H() {\n      var iso = q(\"gdate\").value;\n      if (!iso) { showError(outG2H, \"Selectionne une date gregorienne.\"); return; }\n\n      var parts = iso.split(\"-\");\n      var Y = Number(parts[0]), M = Number(parts[1]), D = Number(parts[2]);\n\n      var jd = gregorianToJD(Y, M, D);\n      var h = jdToHebrew(jd);\n      var hDay = Math.floor(h.day);\n      var monthName = hebrewMonthNameFR(h.year, h.month);\n\n      q(\"hYear\").value = h.year;\n      populateHebrewMonths(h.year);\n      q(\"hMonth\").value = String(h.month);\n      q(\"hDay\").value = String(hDay);\n\n      showOk(outG2H, '<div class=\"hebcal-ok\">' + iso + ' -> ' + hDay + ' ' + monthName + ' ' + h.year + '<\/div>');\n      renderDetails(\"G: \" + iso + \"\\nJD: \" + jd.toFixed(1) + \"\\nH: \" + hDay + \" \" + monthName + \" \" + h.year);\n    }\n\n    function handleH2G() {\n      var year = Number(q(\"hYear\").value);\n      var month = Number(q(\"hMonth\").value);\n      var day = Number(q(\"hDay\").value);\n\n      var err = validateHebrewInput(year, month, day);\n      if (err) { showError(outH2G, err); return; }\n\n      var jd = hebrewToJD(year, month, day);\n      var g = jdToGregorian(jd);\n      var iso = isoFromYMD(g.year, g.month, g.day);\n\n      q(\"gdate\").value = iso;\n      showOk(outH2G, '<div class=\"hebcal-ok\"> ' + day + ' ' + hebrewMonthNameFR(year, month) + ' ' + year + ' -> ' + iso + '<\/div>');\n      renderDetails(\"H: \" + day + \" \" + hebrewMonthNameFR(year, month) + \" \" + year + \"\\nJD: \" + jd.toFixed(1) + \"\\nG: \" + iso);\n    }\n\n    \/\/ bind events\n    q(\"btnToday\").addEventListener(\"click\", function () { setToday(); handleG2H(); });\n    q(\"btnG2H\").addEventListener(\"click\", function () { handleG2H(); });\n    q(\"btnAutoYear\").addEventListener(\"click\", function () {\n      q(\"hYear\").value = currentHebrewYearFromToday();\n      populateHebrewMonths(Number(q(\"hYear\").value));\n    });\n    q(\"btnH2G\").addEventListener(\"click\", function () { handleH2G(); });\n    q(\"hYear\").addEventListener(\"input\", function () {\n      var y = Number(q(\"hYear\").value);\n      if (isFinite(y) && y >= 1) populateHebrewMonths(y);\n    });\n\n    \/\/ init\n    setToday();\n    q(\"hYear\").value = currentHebrewYearFromToday();\n    populateHebrewMonths(Number(q(\"hYear\").value));\n    q(\"hMonth\").value = \"7\";\n    q(\"hDay\").value = \"1\";\n    handleG2H();\n  }\n\n  function bootAll() {\n    var nodes = document.querySelectorAll(\".hebcal-widget-instance\");\n    var i;\n    for (i = 0; i < nodes.length; i++) initOne(nodes[i]);\n  }\n\n  \/\/ DOM ready\n  if (document.readyState === \"loading\") {\n    document.addEventListener(\"DOMContentLoaded\", bootAll);\n  } else {\n    bootAll();\n  }\n\n  \/\/ For builders\/injections\n  try {\n    var obs = new MutationObserver(function () { bootAll(); });\n    obs.observe(document.documentElement, { childList: true, subtree: true });\n  } catch (e) {\n    \/\/ ignore\n  }\n})();\n<\/script>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Convertisseur de dates &#8211; Gregorien \u2194 Hebraique Local (sans API) Gregorien \u2192 Hebraique Date gregorienne Convertir Aujourdhui Choisis une date puis clique sur &#8220;Convertir&#8221;. Note : conversion en jour civil&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-91","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/pages\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":18,"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/pages\/91\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/pages\/91\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/www.aivb-web.fr\/index.php\/wp-json\/wp\/v2\/media?parent=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}