patch with working js date code