Sorry for the delay in responding to this, but this is not a bug, just a
change in how BoltWire works. One of the goals was to minimize the more
arcane syntax. And one key way to do that was to allow more than one
parameter in commands, just like we do in functions.

So rather than

[session time_pubtime "{=pubdate}|%m/%Y/%d" ]

You write

[command time_pubtime set={=pubdate} fmt=%m/%Y/%d]

I'm comparing the time command with the time function--and notice the
latter works differently (ie, when vs set), and a bit better (due fmt). But
even it could be improved. For the next release, I plan to rewrite both of
them to these:

function BOLTXtime($value, $field, $args='') {
## GENERATE TIME RELATED OUTPUT. RECOGNIZES WHEN(#1), FMT
return BOLTfunc($field, $args, 'COMMAND');
}

function BOLTFtime($args, $zone='') {
## VERSATILE TIME FUNCTION. WHEN(#1) IS TIMESTAMP OR TEXT EXPRESSION. FMT
IS STRFTIME RECOGNIZABLE VALUE, WITH ADDITION OF %E (DAY OF MONTH, NO
LEADING 0). CAN SET A DEFAULT TIMEFMT IN SITE.CONFIG. FMT CAN ALSO BE
TIMESTAMP OR DUE (GIVES DAYS UNTIL WHEN).
global $BOLTtime;
if (isset($args['when'])) $t = BOLTfilter($args['when'], 'parameter');
else $t = $args[1];
if (! is_numeric($t) || strlen($t) != 10) $t = strtotime($t);
if ($t == '') $t = $BOLTtime;
if (isset($args['fmt'])) $f = BOLTfilter($args['fmt'], 'parameter');
else $f = $args[2];
if ($f == '') $f = BOLTconfig('timeFmt', '%c');
if ($f == 'timestamp' || $f == '%s') return $t;
if ($args['FMT'] == 'due') return round(($t - $BOLTtime)/86400);
if (strpos($f, '%E') !== false) $f = str_replace('%E', ltrim(strftime('%d',
$t),0), $f);
return strftime($f, $t);
}

The time command will now tap directly into the time function so they are
always consistent. I simplified the time function a bit so it is easier to
read but should work about the same. Due is no longer configurable to other
things besides days, nor is there an offset. For something more
complicated, write a custom function. Can now just write:

[command time_pubtime '{=pubdate}' '%m/%Y/%d']

Not sure when I will release 4.02 but should be soon as I'm upgrading my
main site, and making several tweaks to the code. But you can always
upgrade to the new code now, and start using immediately. Remember this
code is for 4.xx, not 3.xx

Cheers,
Dan




On Tue, Aug 13, 2013 at 11:01 AM, mz <[email protected]> wrote:

> You are right. It works in 3.x but not in 4.x
> This seems to be a bug.
>
> Greetings, Martin
>
> Am Dienstag, 13. August 2013 14:42:44 UTC+2 schrieb jacmgr:
>
>> Here is the same form as above in version 3.5.  It has alwaysa worked for
>> me in 3.5.  Can you try in 3.5 you will see what I am talking about.
>>
>> [form id=boltform]
>>   Publish On:  [text pubdate size=14]
>> [submit SAVE]
>> [session time_pubtime "{=pubdate}|%m/%Y/%d" ]
>> [session pubdatets "{=time_pubtime}"]
>> [session savedata pubdate,time_pubtime,pubdatets ]
>> [form]
>> pubdate: {:pubdate}
>> time_pubtime: {:time_pubtime}
>> pubdatets: {:pubdatets}
>>
>> You will see that the result of the command time_XXX was successfully
>> saved to the varible and then used in the next line to "assign it" to a
>> variable.
>>
>> Oh well, I guess I will stay at 3.5!!!
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "BoltWire" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/boltwire.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to