Except for the <todo:deadline> I added to index.html, I believe the
following are the only changes made to the original tutorial code
Additions to TD.scala
val dateFormat = new SimpleDateFormat("MM/dd/yyyy, hh:mm a")
private def deadline(td: ToDo, reDraw: () => JsCmd) =
swappable(<span class="deadline">{td.deadline}</span>,
<span class="deadline">
{ajaxText(td.deadline.toString,
v => {td.deadline(dateFormat.parse(v)).save;
reDraw()})}
</span>)
This was added to bind in the toList method.
"deadline" -> deadline(td, reDraw)
and this was added to bind in doBind within the add method
"deadline" -> todo.deadline.toForm,
Addition to ToDo.scala
object deadline extends MappedDateTime(this){
val dateFormat = new SimpleDateFormat("MM/dd/yyyy, hh:mm a")
override def defaultValue = time(millis + days(5))
override def asHtml = Text(toString)
override def toString = dateFormat.format(is)
}
On Mar 22, 8:30 am, TylerWeir <[email protected]> wrote:
> Can you add some of your code?
> How you're using MappedDateTime in your snippet and the definition in
> the model would be a good start.
>
> On Mar 21, 9:34 pm, tclendenen <[email protected]> wrote:
>
> > As an exercise I've added a deadline object to the ToDo class. It
> > works as expected except that the time is always set to midnight (ex.
> > 2009-07-16 00:00:00.0) in the database. Is this the expected
> > behavior? Any help is appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---