Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.73 KB | None | 0 0
  1.   object date extends MappedDate(this) {
  2.     override def toForm = {
  3.       val year = Date.Today.getYear
  4.       val month = Date.Today.getMonth
  5.       val day = Date.Today.getDay
  6.  
  7.       val y = SHtml.select((year - 1) to (year + 1) map (i => (i toString, i toString)),
  8.         Full(year.toString), {in: String => apply(Date(i_is_!, in.toInt, -1, -1).getDate)})
  9.       val m = SHtml.select(1 to 12 map (i => (i toString, i toString)),
  10.         Full(month.toString), {in: String => apply(Date(i_is_!, -1, in.toInt, -1).getDate)})
  11.       val d = SHtml.select(1 to 31 map (i => (i toString, i toString)),
  12.         Full(day.toString), {in: String => apply(Date(i_is_!, -1, -1, in.toInt).getDate)})
  13.      
  14.       Full(<div>{y}{m}{d}</div>)
  15.     }
  16.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement