improve Date conversion between java/js