Search.../

getBusinessSchedule( )

Gets the business hours of the site's business.

Description

The getBusinessSchedule() function returns a Promise that resolves to the site's corresponding business hours information.

The retrieved schedule is the schedule that has been entered in the General Info section of your site's Dashboard.

Syntax

function getBusinessSchedule(): GeneralInfoSchedule

getBusinessSchedule Parameters

This function does not take any parameters.

Returns

Fulfilled - An object containing the site business hours. Rejected - Error message.

Return Type:

Promise<GeneralInfoSchedule>
NAME
TYPE
DESCRIPTION
periods
Array<GeneralInfoSchedulePeriods>

List of opening and closing days and times.

specialHourPeriod
Array<GeneralInfoScheduleSpecial>

Special hours.

Was this helpful?

Get site business hours

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import wixSiteBackend from 'wix-site-backend';
3
4export const getBusinessSchedule = webMethod(Permissions.Anyone, () => {
5 return wixSiteBackend.generalInfo.getBusinessSchedule();
6});
7
8/*
9 * {
10 * "periods": [
11 * {
12 * "openDay": "MONDAY",
13 * "openTime": "08:00",
14 * "closeDay": "MONDAY",
15 * "closeTime": "17:00"
16 * },
17 * {
18 * "openDay": "THURSDAY",
19 * "openTime": "09:00",
20 * "closeDay": "THURSDAY",
21 * "closeTime": "18:00"
22 * }
23 * ],
24 * "specialHourPeriod": [
25 * {
26 * "startDate": "31-12-2018",
27 * "endDate": "01-01-2019",
28 * "isClosed": true,
29 * "comment": "new year eve"
30 * }
31 * ]
32 * }
33 */