<commit_before>package seedu.ezdo.commons.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import seedu.ezdo.model.todo.ReadOnlyTask;

/*
 * Checks for dates
 */
public class DateUtil {
    public static boolean isTaskDateValid(ReadOnlyTask task) throws ParseException {
        assert task != null;
        SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy H:mm");
        Date startDate = df.parse(task.getStartDate().toString());
        Date dueDate = df.parse(task.getDueDate().toString());
        if (task.getStartDate().toString().equals("") || task.getDueDate().toString().equals("")) {
            return true;
        }
        return (startDate.compareTo(dueDate) < 0);
    }


    /**
     * Compares two dates strings. Both strings must be in the format dd/MM/yyyy hh:mm.
     * Empty strings are considered to be of lower value than non-empty strings.
     * @return an int representing the comparison result of the two date strings.
     * @throws ParseException if any of the date strings cannot be parsed.
     */
    public static int compareDateStrings(String dateString1, String dateString2) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy kk:mm");
        Date date1 = null;
        Date date2 = null;

        // empty dates are considered lower in value so that they show at the bottom of the list
        if (dateString1.isEmpty() && dateString2.isEmpty()) {
            return 0;
        } else if (dateString1.isEmpty()) {
            return 1;
        } else if (dateString2.isEmpty()) {
            return -1;
        }

        try {
            date1 = dateFormat.parse(dateString1);
            date2 = dateFormat.parse(dateString2);
        } catch (ParseException pe) {
            assert false : "The date format should not be invalid.";
        }

        return date1.compareTo(date2);
    }
}<commit_msg>Fix error in date parsing<commit_after>package seedu.ezdo.commons.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import seedu.ezdo.model.todo.ReadOnlyTask;

/*
 * Checks for dates
 */
public class DateUtil {
    public static boolean isTaskDateValid(ReadOnlyTask task) throws ParseException {
        assert task != null;
        SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy H:mm");
        Date startDate = df.parse(task.getStartDate().toString());
        Date dueDate = df.parse(task.getDueDate().toString());
        if (task.getStartDate().toString().equals("") || task.getDueDate().toString().equals("")) {
            return true;
        }
        return (startDate.compareTo(dueDate) < 0);
    }


    /**
     * Compares two dates strings. Both strings must be in the format dd/MM/yyyy hh:mm.
     * Empty strings are considered to be of lower value than non-empty strings.
     * @return an int representing the comparison result of the two date strings.
     * @throws ParseException if any of the date strings cannot be parsed.
     */
    public static int compareDateStrings(String dateString1, String dateString2) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
        Date date1 = null;
        Date date2 = null;

        // empty dates are considered lower in value so that they show at the bottom of the list
        if (dateString1.isEmpty() && dateString2.isEmpty()) {
            return 0;
        } else if (dateString1.isEmpty()) {
            return 1;
        } else if (dateString2.isEmpty()) {
            return -1;
        }

        try {
            date1 = dateFormat.parse(dateString1);
            date2 = dateFormat.parse(dateString2);
        } catch (ParseException pe) {
            assert false : "The date format should not be invalid.";
        }

        return date1.compareTo(date2);
    }
}
{'fraction_non_alphanumeric': 0.10217842323651452, 'fraction_numerical': 0.00933609958506224, 'mean_word_length': 2.5159525979945307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1080915', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1046, 'n_words': 330}