{"id":323,"date":"2025-06-19T13:59:34","date_gmt":"2025-06-19T11:59:34","guid":{"rendered":"https:\/\/melba.hu\/reservation\/"},"modified":"2026-02-08T19:43:43","modified_gmt":"2026-02-08T18:43:43","slug":"reservation","status":"publish","type":"page","link":"https:\/\/melba.hu\/en\/reservation\/","title":{"rendered":"Reservation"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"323\" class=\"elementor elementor-323\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-299b161 e-flex e-con-boxed e-con e-parent\" data-id=\"299b161\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5504a83 elementor-widget elementor-widget-html\" data-id=\"5504a83\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script>\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n    \n\n\/\/ MELBA BISTRO - Automatikus d\u00e1tum kit\u00f6lt\u0151 (M\u0170K\u00d6D\u0150 VERZI\u00d3)\n\/\/ Haszn\u00e1lat: https:\/\/melba.hu\/reservation\/?date=2026-02-14\n\n(function() {\n    \/\/ URL param\u00e9ter kiolvas\u00e1sa\n    const urlParams = new URLSearchParams(window.location.search);\n    const dateParam = urlParams.get('date');\n    \n    if (!dateParam) {\n        console.log('\u26a0\ufe0f Nincs date param\u00e9ter az URL-ben');\n        return;\n    }\n    \n    console.log('\ud83d\uddd3\ufe0f D\u00e1tum param\u00e9ter:', dateParam);\n    \n    \/\/ D\u00e1tum parse-ol\u00e1sa\n    const match = dateParam.match(\/(\\d{4})-(\\d{2})-(\\d{2})\/);\n    if (!match) {\n        console.error('\u274c Hib\u00e1s d\u00e1tum form\u00e1tum! Haszn\u00e1lj YYYY-MM-DD form\u00e1tumot (pl. 2026-02-14)');\n        return;\n    }\n    \n    const year = parseInt(match[1]);\n    const month = parseInt(match[2]) - 1; \/\/ pickadate.js 0-indexelt (0=janu\u00e1r, 1=febru\u00e1r, stb.)\n    const day = parseInt(match[3]);\n    \n    console.log('\ud83d\udcc5 Parsed d\u00e1tum:', { year, month: month + 1, day });\n    \n    \/\/ D\u00e1tum be\u00e1ll\u00edt\u00e1sa\n    function setDate() {\n        \/\/ Ellen\u0151rizz\u00fck, hogy jQuery \u00e9s pickadate be van-e t\u00f6ltve\n        if (typeof jQuery === 'undefined') {\n            console.warn('\u23f3 jQuery m\u00e9g nem t\u00f6lt\u0151d\u00f6tt be...');\n            return false;\n        }\n        \n        if (typeof jQuery.fn.pickadate === 'undefined') {\n            console.warn('\u23f3 pickadate.js m\u00e9g nem t\u00f6lt\u0151d\u00f6tt be...');\n            return false;\n        }\n        \n        \/\/ Keress\u00fck meg a d\u00e1tum mez\u0151t\n        const $dateInput = jQuery('#rtb-date');\n        \n        if ($dateInput.length === 0) {\n            console.warn('\u23f3 D\u00e1tum mez\u0151 (#rtb-date) m\u00e9g nem l\u00e9tezik...');\n            return false;\n        }\n        \n        \/\/ Pr\u00f3b\u00e1ljuk meg lek\u00e9rni a picker-t\n        try {\n            const picker = $dateInput.pickadate('picker');\n            \n            if (!picker) {\n                console.warn('\u23f3 Picker m\u00e9g nincs inicializ\u00e1lva...');\n                return false;\n            }\n            \n            \/\/ Be\u00e1ll\u00edtjuk a d\u00e1tumot!\n            picker.set('select', [year, month, day]);\n            console.log('\u2705 D\u00e1tum sikeresen be\u00e1ll\u00edtva:', dateParam);\n            return true;\n            \n        } catch (error) {\n            console.warn('\u23f3 Hiba a picker el\u00e9r\u00e9sekor:', error.message);\n            return false;\n        }\n    }\n    \n    \/\/ Pr\u00f3b\u00e1lkoz\u00e1sok ism\u00e9telt id\u0151z\u00edt\u00e9ssel\n    let attempts = 0;\n    const maxAttempts = 20; \/\/ 20 pr\u00f3b\u00e1lkoz\u00e1s = ~6 m\u00e1sodperc\n    \n    function trySetDate() {\n        attempts++;\n        \n        if (setDate()) {\n            console.log('\ud83c\udf89 Sikeres be\u00e1ll\u00edt\u00e1s ' + attempts + '. pr\u00f3b\u00e1lkoz\u00e1sra!');\n            return;\n        }\n        \n        if (attempts < maxAttempts) {\n            setTimeout(trySetDate, 300);\n        } else {\n            console.error('\u274c Nem siker\u00fclt automatikusan be\u00e1ll\u00edtani ' + maxAttempts + ' pr\u00f3b\u00e1lkoz\u00e1s ut\u00e1n.');\n            console.log('\ud83d\udca1 Pr\u00f3b\u00e1ld manu\u00e1lisan:');\n            console.log(`jQuery('#rtb-date').pickadate('picker').set('select', [${year}, ${month}, ${day}]);`);\n        }\n    }\n    \n    \/\/ Ind\u00edt\u00e1s\n    if (document.readyState === 'loading') {\n        document.addEventListener('DOMContentLoaded', () => {\n            setTimeout(trySetDate, 500);\n        });\n    } else {\n        setTimeout(trySetDate, 500);\n    }\n    \n})();\n\n\n});\n<\/script>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"melba-sablon","meta":{"_crdt_document":"","footnotes":""},"class_list":["post-323","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/pages\/323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/comments?post=323"}],"version-history":[{"count":15,"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/pages\/323\/revisions"}],"predecessor-version":[{"id":4155,"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/pages\/323\/revisions\/4155"}],"wp:attachment":[{"href":"https:\/\/melba.hu\/en\/wp-json\/wp\/v2\/media?parent=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}