fix bug about month and ensure date for a day exist only once