validating date before using momentJs