package com.doverfuelingsolutions.issp.utils

import com.doverfuelingsolutions.issp.R
import java.text.SimpleDateFormat
import java.util.*

object TimeUtil {

    private val defaultFormatter: SimpleDateFormat by lazyOf(SimpleDateFormat(StringUtil.get(R.string.format_date), Locale.CHINA))

    private fun dateFormat(date: Date) = defaultFormatter.format(date)
    private fun dateFormat(date: Date, format: String) = SimpleDateFormat(format, Locale.CHINA).format(date)

    fun dateFormat(mills: Long): String = defaultFormatter.format(Date(mills))
    private fun dateFormat(mills: Long, format: String) = SimpleDateFormat(format, Locale.CHINA).format(Date(mills))
}