parseDates method

Future<List<SmartDateQueryResult>> parseDates(
  1. String text, {
  2. bool isFlexiDate = false,
  3. IRef? contact,
  4. FutureOr<List<IFact>>? facts,
  5. Location? location,
})

Implementation

Future<List<SmartDateQueryResult>> parseDates(String text,
    {bool isFlexiDate = false,
    IRef? contact,
    FutureOr<List<IFact>>? facts,
    Location? location}) async {
  try {
    final _facts = (await facts ?? []);
    final matches = enableFacts
        ? await factService.findFactSchemas(text)
        : <FactDateSchemaQuery>[];

    var result = await _resolveAndQuery(
      text: text,
      isFlexiDate: isFlexiDate,
      contact: contact,
      facts: _facts,
      matches: matches,
      location: location,
    );

    return result;
  } catch (e, stack) {
    log.severe("Error fetching date results $e", e, stack);
    rethrow;
  }
}