How to use the @microsoft/recognizers-text-data-types-timex-expression.creator.daytime function in @microsoft/recognizers-text-data-types-timex-expression

To help you get started, we’ve selected a few @microsoft/recognizers-text-data-types-timex-expression examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / BotBuilder-Samples / samples / javascript_nodejs / 51.cafe-bot / dialogs / shared / stateProperties / reservationProperty.js View on Github external
const MAX_PARTY_SIZE = 10;

// Date constraints for reservations
/* Date for reservations must be:
    - a date in this week .OR.
    - a date in the next 4 weeks
*/
const reservationDateConstraints = [
    creator.thisWeek,
    creator.nextWeeksFromToday(FOUR_WEEKS)
];

// Time constraints for reservations
// Time for reservations must be daytime
const reservationTimeConstraints = [
    creator.daytime
];

/**
 * Reservation property class.
 * - This is a self contained class that exposes a bunch of public methods to
 *   evaluate if we have a complete instance (all required properties filled in)
 * - Generate reply text
 *     - based on missing properties
 *     - with all information that's already been captured
 *     - to confirm reservation
 *     - to provide contextual help
 * - Also exposes two static methods to construct a reservations object based on
 *     - LUIS results object
 *     - arbitrary object
 */
class ReservationProperty {