solve the problem for safari that new Date('2012-1-2') is invalid