Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Getting FI Holidays

Q2 Central manages our Bank Holiday list:
file

Is there a way in the SDK to easily get these dates?

The closest thing that I have found is https://docs.q2developer.com/api_references/q2_sdk/db/db_objects/hours.html, but I am wondering what the hour type would be that I would provide the get function and if that would be the most efficient lookup.

I am trying to do a calculation of business days in my extension and would like to be able to exclude these defined holidays if possible. Any help that anyone could provide is greatly appreciated. Thank you!

Posted 4 years ago
Votes Newest

Answers


Hi Dan,

You can grab holidays using the Hours object, and I recommend passing in the hour_type of GeneratedTransaction, and choosing a transaction type that holidays is set for, like so:

holidays_hours = Hours(logger=self.context.logger)
holidays= await holidays_hours.get(hour_type=HourType.GeneratedTransaction, transaction_type=TransactionType('AchBatch'))

The resulting data dictionary should have all the holidays that you set in Q2Central.

Best,
Mark

Posted 4 years ago
Mark Ostroth
309 × 5 Administrator
0

Thanks, Mark!

— Dan Collins   4 years ago
115 Views
1 Answer
4 years ago
4 years ago
Tags