fixing date bug in es