Between X:XX and Y:YY regular training occurs, but all other time "long" training occurs.
Long training is to make it look like you are sleeping for the night, etc. So:
If the next short training goes beyond the time to start (beyond Y:YY) night training, it'll start training the longest skill on the long skill list.
Only one long training is picked per "night" (beyond Y:YY), if it ends before "morning (X:XX) then the slot will remain unused until short training are ready to be used again.
Alternatively, if that is too complex, you could just have an option to toggle "Long/Short" and just maintain two arrays, one for normal (aka short) and one for long. Flipping it to long will toggle for each slot to get one long training before returning to shorts.