Real Time Clock Issue with PIC18F87K22
Does microchip recommend that you connect the pencil lead crystal directly with no small capacitors to ground? You should check their data sheet and any app notes carefully.

Let me add that the Microchip MCU designs that I have done all have an external I2C RTC chip. The reason for this is that the RTC chips have a very convenient way to connect a small coil cell battery to one pin and another pin for the normal 3V3 VDD connection. Interface to the RTC is via a simple two wire interface which is in most cases already in use for other things as well so no extra GPIO loading for the RTC. 

Trying to support a battery for the PIC MCU when it goes into sleep mode when the main power supply goes off adds the cost of extra components that can be eliminated when an external MCU is used. I have also found that the management of the RTC programming is less susceptible to upsets in the MCU software and so the current RTC readings can be more dependable. 

To their credit Microchip has always done a great job of implementing low power sleep and idle modes on most of their MCUs. However I still wonder why we do not see a separate VBATT pin supported on their parts.