Question

I was wondering if anyone with some Jelly experience would happen know how one would go about grabbing the pretty_format version of a Timestamp out of a Jelly_Field_Timestamp?

I wouldn't mind doing date($pretty_format, $value) as long as I could somehow get that $pretty_format value as I'm looping through my records.

$tasks = Jelly::select('task')->execute();
foreach ($tasks as $task)
{
    $task->time;
    #??? $task->time->pretty_format;
    #??? date($pretty_format, $task->time)
}

Something like this has to be possible... is it not?

Was it helpful?

Solution

Iirc, this is one way to do it:

$time_prettyformat = Jelly::builder('task')->fields('time')->pretty_format;

Another would be:

$task->meta()->fields('time')->pretty_format;

Note, this method only works in 0.9.x versions of Jelly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top