How to use the @microsoft/recognizers-text-data-types-timex-expression.creator.nextWeeksFromToday 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 PARTY_SIZE_ENTITY = LUIS_ENTITIES.number;
const DATE_TIME_ENTITY = LUIS_ENTITIES.datetime;
const LOCATION_ENTITY = LUIS_ENTITIES.cafeLocation;
const CONFIRMATION_ENTITY = LUIS_ENTITIES.confirmationList;

const FOUR_WEEKS = '4';
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