mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
Initial Import.
This commit is contained in:
23
src/main/scala/view/helpers.scala
Normal file
23
src/main/scala/view/helpers.scala
Normal file
@@ -0,0 +1,23 @@
|
||||
package view
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
object helpers {
|
||||
|
||||
def datetime(date: Date): String = {
|
||||
new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(date)
|
||||
}
|
||||
|
||||
def date(date: Date): String = {
|
||||
new SimpleDateFormat("yyyy/MM/dd").format(date)
|
||||
}
|
||||
|
||||
def cut(message: String, length: Int): String = {
|
||||
if(message.length > length){
|
||||
message.substring(0, length) + "..."
|
||||
} else {
|
||||
message
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user