Subject Re: Usage of TIB_Date: FIX
Author Marco Menardi
Sorry, but seems that the "reply" button of the group is not working
today (or is it with Mozilla 1.5?), so I write a brand new message
with the answer. If someone has the same problem (you press "Send" and
nothing changes in the list, nor you change page) let me know.
Here the "real message" with the answer:
--------
--- In IBObjects@yahoogroups.com, "Riho-Rene Ellermaa"
<r.ellermaa@h...> wrote:
> I'm from Estonia and my application needs to work also in Latvia and
Lithuania.
> Our date format is DD.MM.YYYY, but lithuanians use YYYY.MM.DD and
latvians YYYY/MM/DD
>
>
> Riho-Rene Ellermaa
> senior programmer

Ok, here the fix:
File: IBC_Date.IMP
change the UpdateMask procedure with the following code:
procedure TIB_CustomDate.UpdateMask( UnboundMask: string );
begin
if UnboundMask = '' then
begin
if copy(AnsiLowerCase(ShortDateFormat), 1, 1) = 'y' then // year
first, like in Lithuanian and Latvian countries
UnboundMask := '!9999' + DateSeparator + '99' + DateSeparator +
'99;1; '
else
UnboundMask := '!99' + DateSeparator + '99' + DateSeparator +
'9999;1; ';
end;
inherited UpdateMask( UnboundMask );
end;

That, in my tests, seems to work, and, contrary to what I supposed,
Autofil property works as well.
To Jason: since I don't have access to your code, could you please
merge this improvement in the forecoming subrelease?
In IBC_Date.int credits section there is to add:
{ Marco Menardi <mmenaz@...>
}
{ 16-Oct-2003
}
{ Added support while unbound for date format like yyyy/mm/dd
(year first) }
{ used in countries like Lithuanian and Latvian
}
{
}

Thanks
Marco Menardi