spells.CalendarOpsModule.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spells_2.11 Show documentation
Show all versions of spells_2.11 Show documentation
This is a small scala "util" library, which will hopefully grow over time.
The newest version!
package spells
/** Provides utility methods for java.util.Calendar. */
trait CalendarOpsModule {
this: CustomRenderingModule with DateOpsModule with StringOpsModule with SpellsConfigModule =>
import java.text.SimpleDateFormat
import java.util.Calendar
implicit final class CalendarOpsFromSpells(value: Calendar) extends CustomRendering {
override final def rendered(implicit availableWidthInCharacters: StringOpsModule#AvailableWidthInCharacters = SpellsConfig.terminal.WidthInCharacters.value): String =
new SimpleDateFormat(DateOpsFromSpells.Defaults.Format) format value.getTime
}
}