Primarily intended for use on the primary_ids of future_series instruments.
This will sort ids by expiration. All ids that do not contain month and year information
will be sorted alphabetically (separately) and appended to the end of the other sorted ids.
If an instrument is defined, and has a date in its ‘expires’ field, that date will be
used as the expiration date. Otherwise, it is assumed that the contract expires
on the first day of its expiration month. This means that if some products are defined
and other products that expire in the same month are not defined, the ones that are
not defined will come first in the vector of sorted ids.