Date coercion

Jake Savin jake at userland.com
Thu May 29 03:02:54 PDT 2003


Hi Chris, replying offlist due to political sensitivities...

The fix was already applied to Radio, but unfortunately I had to back 
off a bit due to potential breakage issues. Rather than make date 
coercion always fail when an invalid date is passed to date(), I've 
added an optional parameter. If you want to get an error when an 
invalid date is passed in, use something like this:

date ("foo", true) //will cause an error

Again, this change was applied also to Radio, so you'll have the 
functionality you need there, as long as you pass in true for the value 
of the 2nd parameter.

Thanks, and sorry the fix was not ideal...

-Jake

On Wednesday, May 28, 2003, at 02:52 PM, Chris Bunch wrote:

> Thanks Jake -
>
> Quick work! Now I'll have to delete my workaround. ;-)
>
> Will you fix this in Radio as well? That’s where I usually test things 
> out.
>
> C
> __________________________________
>
>
>
>> Hi Chris,
>>
>> This was indeed a bug. A fix has been released. To get the fix, update
>> Frontier.root.
>>
>> Thanks,
>> -Jake
>>
>> On Wednesday, May 28, 2003, at 11:13 AM, Chris Bunch wrote:
>>
>>> According to DocServer (http://docserver.userland.com/coercion/date),
>>> coercing to a date should fail with an error if the object being
>>> coerced is
>>> not of the appropriate type.
>>>
>>> This appears not to work as billed omm (Mac OS X).
>>> Try the following in QuickScript:
>>>
>>> date("31-Jan-2002")  -- works OK, displays appropriate date string
>>> date("31-Feb-2002")  -- returns true: does not throw an error
>>> date("garbage")      -- returns true: does not throw an error
>>>
>>> Does DocServer need updating or is this a Bug?
>>>
>>
>>
>




More information about the Frontier-Users mailing list