{"id":422,"date":"2023-03-11T21:30:24","date_gmt":"2023-03-11T13:30:24","guid":{"rendered":"https:\/\/wip.rccn.dev\/?p=422"},"modified":"2023-04-10T13:40:58","modified_gmt":"2023-04-10T05:40:58","slug":"service-calendar","status":"publish","type":"post","link":"https:\/\/rccn.dev\/zh\/utilities\/service-calendar\/","title":{"rendered":"Service Calendar"},"content":{"rendered":"<div id=\"ea-full-calendar-69d8870d2eb20\"><\/div><div class=\"fc\">\n    <div id=\"ea-calendar-color-map-69d8870d2eb20\" class=\"ea-calendar-color-map fc-view-container\">\n        <div>Status<\/div>\n        <div data-class=\"grape\" class=\"fc-event status grape\">pending<\/div>\n        <div data-class=\"darkgreen\" class=\"fc-event status darkgreen\">confirmed<\/div>\n        <div data-class=\"darkblue\" class=\"fc-event status darkblue\">reservation<\/div>\n        <div data-class=\"graffit\" class=\"fc-event status graffit\">cancelled<\/div>\n    <\/div>\n<\/div><style><\/style>\n<script>\n  jQuery(document).ready(function() {\n\n    jQuery(document).on('click', '.ea-edit-appointment-icon', function (e) {\n        jQuery(\".ea-edit-appointment-wrapper\").show();\n        jQuery(\"#ea_event_popup\").hide();\n        jQuery(\".ea-edit-appointment-icon\").hide();\n    });\n    jQuery(document).on('click', '.ea-cancel-edit', function (e) {\n        jQuery(\".ea-edit-appointment-wrapper\").hide();\n        jQuery(\"#ea_event_popup\").show();\n        jQuery(\".ea-edit-appointment-icon\").show();\n    });\n  \n    jQuery('#ea-calendar-color-map-69d8870d2eb20').find('.status').hover(\n        function(event) {\n            var el = jQuery(event.target);\n            var classSelector = '.' + el.data('class');\n            jQuery('#ea-full-calendar-69d8870d2eb20').find('.fc-event:not(' + classSelector + ')').animate({ opacity: 1\/2 }, 200);\n        },\n    function(event){\n        jQuery('#ea-full-calendar-69d8870d2eb20').find('.fc-event').animate({ opacity: 1 }, 100);\n    });\n\n    jQuery('#ea-full-calendar-69d8870d2eb20').fullCalendar({\n      header: {\n        left: 'prev,next today',\n        center: 'title',\n        right: 'month,basicWeek,basicDay'\n      },\n      dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],\n      dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],\n      monthNamesShort: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],\n      monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'],\n      buttonText: {\n        today: 'today',\n        month: 'month',\n        week:  'week',\n        day:   'day',\n        list:  'list'\n      },\n      views: {\n        month: {\n          titleFormat: 'MMM YYYY',\n        },\n        week: {\n          titleFormat: 'MMM DD, YYYY',\n        },\n        day: {\n          titleFormat: 'MMM DD, YYYY',\n        }\n      },\n      isRTL: false,\n      defaultView: 'month',\n      showNonCurrentDates: false,\n      timeFormat: 'H:mm',\n      \n      displayEventEnd: false,\n      weekNumbers: false,\n      firstDay: 1,\n      defaultDate: '2026-04-10',\n      navLinks: true, \/\/ can click day\/week names to navigate views\n      editable: false,\n      eventLimit: true, \/\/ allow \"more\" link when too many events\n      events: {\n        url: wpApiSettings.root + 'easy-appointments\/v1\/appointments',\n        type: 'GET',\n        data: {\n          _wpnonce: wpApiSettings.nonce,\n          hide_cancelled: '0',\n          location: '1',\n          \n          \n          \n          title_field: 'name',\n        },\n        error: function() {\n          console.log('there was an error while fetching events!');\n        },\n        textColor: 'white' \/\/ a non-ajax option\n      },\n      eventClick: function(calEvent, jsEvent, view) {\n        \/\/ console.log(calEvent, jsEvent, view);\n      },\n      eventRender: function(event, element) {\n        var statusMapping = {\n          canceled: 'graffit',\n          confirmed: 'darkgreen',\n          pending: 'grape',\n          reserved: 'darkblue'\n        }\n \n        element.addClass(statusMapping[event.status]);\n                element.addClass('thickbox');\n        element.addClass('ea-full-calendar-dialog-event');\n        element.attr('href', wpApiSettings.root + 'easy-appointments\/v1\/appointment\/' + event.id + '?hash=' + event.hash + '&eventpopup=yes&_wpnonce=' + wpApiSettings.nonce + '&width=100%&height=100%');\n        element.attr('title', '#' + event.id + ' - ' + _.escape(event.title));\n      }\n    });\n    \n  });\n<\/script>","protected":false},"excerpt":{"rendered":"","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_uag_custom_page_level_css":"","neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[29],"tags":[],"class_list":["post-422","post","type-post","status-publish","format-standard","hentry","category-utilities"],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false,"neve-blog":false},"uagb_author_info":{"display_name":"Raccoon Local User","author_link":"https:\/\/rccn.dev\/zh\/author\/rccn_local_user\/"},"uagb_comment_info":0,"uagb_excerpt":null,"_links":{"self":[{"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/posts\/422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/comments?post=422"}],"version-history":[{"count":5,"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":500,"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/posts\/422\/revisions\/500"}],"wp:attachment":[{"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/media?parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/categories?post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rccn.dev\/zh\/wp-json\/wp\/v2\/tags?post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}