[Gambas-user] Bug with IsDate

Benoît Minisini g4mba5 at gmail.com
Sat Dec 12 17:41:18 CET 2020


Le 08/12/2020 à 19:13, Jussi Lahtinen a écrit :
> Currently in dev version IsDate does not understand the localization:
> ? IsDate(Str(Now))
> False
> 
> $ locale
> LANG=en_US.UTF-8
> LANGUAGE=en_US
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC=fi_FI.UTF-8
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY=fi_FI.UTF-8
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER=fi_FI.UTF-8
> LC_NAME=fi_FI.UTF-8
> LC_ADDRESS=fi_FI.UTF-8
> LC_TELEPHONE=fi_FI.UTF-8
> LC_MEASUREMENT=fi_FI.UTF-8
> LC_IDENTIFICATION=fi_FI.UTF-8
> LC_ALL=
> 
> 
> Jussi
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

It should be fixed in commit 
https://gitlab.com/gambas/gambas/-/commit/93659c3f7eab356b922d5be161990bf888fb3fd8.

Now Str() on dates returns something that Val() and IsDate() can understand.

A function that could be named "Date.FromString()" should be made for 
understanding any local date in any format. Val() and IsDate() cannot be 
made clever enough for that, too complex!

Regards,

-- 
Benoît Minisini


More information about the User mailing list