<commit_before>import {FormatFn} from '../utils/basic-types';
import {format} from './format';
import {isValidDate} from '../create/create-ts-date';
import {leadZero} from '../utils/utils';


// YYYY-MM-DD
export const formatDateIso: FormatFn = (date: Date | null): any => {
	if (!isValidDate(date)) return null;
	return leadZero(date.getFullYear(), 4) + '-' + leadZero(date.getMonth() + 1) + '-' + leadZero(date.getDate());
};

// YYYY-MM-DDTHH:mm
export const formatDateTimeIso: FormatFn = (date: Date | null): any => {
	if (!isValidDate(date)) return null;
	return formatDateIso(date) + 'T' + leadZero(date.getHours()) + ':' + leadZero(date.getMinutes());<commit_msg>refactor: removed unused import<commit_after>import {FormatFn} from '../utils/basic-types';
import {isValidDate} from '../create/create-ts-date';
import {leadZero} from '../utils/utils';


// YYYY-MM-DD
export const formatDateIso: FormatFn = (date: Date | null): any => {
	if (!isValidDate(date)) return null;
	return leadZero(date.getFullYear(), 4) + '-' + leadZero(date.getMonth() + 1) + '-' + leadZero(date.getDate());
};

// YYYY-MM-DDTHH:mm
export const formatDateTimeIso: FormatFn = (date: Date | null): any => {
	if (!isValidDate(date)) return null;
	return formatDateIso(date) + 'T' + leadZero(date.getHours()) + ':' + leadZero(date.getMinutes());
{'fraction_non_alphanumeric': 0.19622641509433963, 'fraction_numerical': 0.0030188679245283017, 'mean_word_length': 4.867256637168142, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1970363', 'n_tokens_mistral': 461, 'n_tokens_neox': 458, 'n_words': 104}