add new record send data with category and input date, and do some refactoring of this code