<commit_before>package com.cryart.sabbathschool.core.misc

import org.joda.time.DateTime
import org.joda.time.format.DateTimeFormat
import timber.log.Timber

object DateHelper {

    fun parseDate(date: String): DateTime? {
        return try {
            DateTimeFormat.forPattern(SSConstants.SS_DATE_FORMAT)
                .parseLocalDate(date).toDateTimeAtStartOfDay()
        } catch (ex: Exception) {
            Timber.e(ex)
            null
        }
    }

    fun formatDate(date: String, format: String = SSConstants.SS_DATE_FORMAT_OUTPUT_DAY): String {
        return try {
            DateTimeFormat.forPattern(format)
                .print(
                    DateTimeFormat.forPattern(SSConstants.SS_DATE_FORMAT)
                        .parseLocalDate(date)
                ).replaceFirstChar { it.uppercase() }
        } catch (ex: IllegalArgumentException) {
            Timber.e(ex)
            return ""
        }
    }
}<commit_msg>Add method to return today's date formatted<commit_after>package com.cryart.sabbathschool.core.misc

import org.joda.time.DateTime
import org.joda.time.LocalDate
import org.joda.time.format.DateTimeFormat
import timber.log.Timber

object DateHelper {

    fun parseDate(date: String): DateTime? = try {
        DateTimeFormat.forPattern(SSConstants.SS_DATE_FORMAT)
            .parseLocalDate(date).toDateTimeAtStartOfDay()
    } catch (ex: Exception) {
        Timber.e(ex)
        null
    }

    fun formatDate(date: String, format: String = SSConstants.SS_DATE_FORMAT_OUTPUT_DAY): String = try {
        DateTimeFormat.forPattern(format)
            .print(
                DateTimeFormat.forPattern(SSConstants.SS_DATE_FORMAT)
                    .parseLocalDate(date)
            ).replaceFirstChar { it.uppercase() }
    } catch (ex: IllegalArgumentException) {
        Timber.e(ex)
        ""
    }

    fun today() = formatDate(LocalDate.now().toString(SSConstants.SS_DATE_FORMAT))
}
{'fraction_non_alphanumeric': 0.09548254620123203, 'fraction_numerical': 0.0, 'mean_word_length': 2.4013961605584644, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4334965', 'n_tokens_mistral': 569, 'n_tokens_neox': 545, 'n_words': 94}