js snippet about date added into