SIT.date package is the collection of functions to ease extraction of date period ends.
The first function that i want to highlight is the date.ends function. This is a user friendly wrapper to compute periods ends with optional logic to handle holidays if holiday calendar is provided. It handles various commonly used periodicity by mapping them into corresponding end period functions. For example, weeks, week, weekly, and w are all mapped into `date.week.ends’.
It also handles bi-weekly syntax by taking every other period end. For more precise handling you can directly specify by and skip input parameters.
Please note the date.ends function works differently depending on the input data type. I.e. if xts object is given, assume that xts is sourced from historical data and does not contain holidays otherwise first filter out non business days and next apply dates periodicity function.
The custom.date.bus function also takes in the holiday calendar to properly adjust for holidays.
# the expiration months are the first month of each quarter - January, April, July, October.