def _end_apply_index(self, dtindex):
off = dtindex.to_perioddelta('<STR_LIT:D>')<EOL>base, mult = libfrequencies.get_freq_code(self.freqstr)<EOL>base_period = dtindex.to_period(base)<EOL>if not isinstance(base_period._data, np.ndarray):<EOL><INDENT>base_period = base_period._data<EOL><DEDENT>if self.n > <NUM_LIT:0>:<EOL><INDENT>normed = dtindex - off + Timedelta(<NUM_LIT:1>, '<STR_LIT:D>') - Timedelta(<NUM_LIT:1>, '<STR_LIT>')<EOL>roll = np.where(base_period.to_timestamp(how='<STR_LIT:end>') == normed,<EOL>self.n, self.n - <NUM_LIT:1>)<EOL>shifted = base_period._addsub_int_array(roll, operator.add)<EOL>base = shifted.to_timestamp(how='<STR_LIT:end>')<EOL><DEDENT>else:<EOL><INDENT>roll = self.n<EOL>base = base_period._time_shift(roll).to_timestamp(how='<STR_LIT:end>')<EOL><DEDENT>return base + off + Timedelta(<NUM_LIT:1>, '<STR_LIT>') - Timedelta(<NUM_LIT:1>, '<STR_LIT:D>')<EOL>
Add self to the given DatetimeIndex, specialized for case where
self.weekday is non-null.

Parameters
----------
dtindex : DatetimeIndex

Returns
-------
result : DatetimeIndex