<commit_before>const DATE_FORMAT = "YYYY-MM-DD";
const oneDayInMs = moment.duration(1, "day").asMilliseconds();

function daysInInterval (start, end) {
    const startMs = moment(start).startOf("day").valueOf();
    const endMs = moment(end).startOf("day").valueOf();
    const numberOfDays = (endMs - startMs) / oneDayInMs;
    const days = [];
    for (var i=0; i<numberOfDays; i++) {
        days.push(
            moment(startMs).add(i, "days").format(DATE_FORMAT)
        );
    }
    return days;
}

function getIds (sensorId, dateStart, dateEnd, source, measurementType) {
    return daysInInterval(dateStart, dateEnd).map(day => (
        `${sensorId}-${day}-${source}-${measurementType}`
    ));
}<commit_msg>Fixed bug in publications if the day of start and end are the same.<commit_after>const DATE_FORMAT = "YYYY-MM-DD";
const oneDayInMs = moment.duration(1, "day").asMilliseconds();

function daysInInterval (start, end) {
    if (start === end) {
        return [start];
    }
    const startMs = moment(start).startOf("day").valueOf();
    const endMs = moment(end).startOf("day").valueOf();
    const numberOfDays = (endMs - startMs) / oneDayInMs;
    const days = [];
    for (var i=0; i<numberOfDays; i++) {
        days.push(
            moment(startMs).add(i, "days").format(DATE_FORMAT)
        );
    }
    return days;
}

function getIds (sensorId, dateStart, dateEnd, source, measurementType) {
    return daysInInterval(dateStart, dateEnd).map(day => (
        `${sensorId}-${day}-${source}-${measurementType}`
    ));
}
{'fraction_non_alphanumeric': 0.16375404530744336, 'fraction_numerical': 0.0025889967637540453, 'mean_word_length': 3.4553314121037464, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6639779', 'n_tokens_mistral': 500, 'n_tokens_neox': 496, 'n_words': 108}