Corrected JS Date instance detection

use instance of instead of typeof to identify
object inherited from Date is better.