[Scilab-users] SEP: upgrading weekday()

classic Classic list List threaded Threaded
10 messages Options
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Scilab-users] SEP: upgrading weekday()

Dear co-scilabers,

A bug report recently posted about the weekday() function invites me to propose to upgrade this simple function.

Presently, weekday() accepts only one poorly explicit numerical date format.

By the way, when it is requested, it is currently not possible to get the day name in en_US language as a standard. Only the locale version is returned.

A proposal to extend weekday() is attached. It is also available on the Scilab wiki:

https://wiki.scilab.org/SEP/2017%20-%20weekday()%20uppgrade


Any comment and input is welcome.

Regards
Samuel Gougeon


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

SEP_2017_weekday_Wiki.pdf (42K) Download Attachment
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Scilab-users] Call for reviewer <= SEP: upgrading weekday()

Hello,

The new implementation of weekday() is now pushed and available on the CodeReview:
https://codereview.scilab.org/#/c/19326/
Its updated help page is attached.

It now expects to be reviewed before merging. Any contributor is welcome to do so online.
Thanks

Best regards
Samuel Gougeon

Le 04/07/2017 à 22:35, Samuel Gougeon a écrit :

Dear co-scilabers,

A bug report recently posted about the weekday() function invites me to propose to upgrade this simple function.

Presently, weekday() accepts only one poorly explicit numerical date format.

By the way, when it is requested, it is currently not possible to get the day name in en_US language as a standard. Only the locale version is returned.

A proposal to extend weekday() is attached. It is also available on the Scilab wiki:

https://wiki.scilab.org/SEP/2017%20-%20weekday()%20uppgrade


Any comment and input is welcome.

Regards
Samuel Gougeo


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

weekday_en_US.pdf (71K) Download Attachment
Richard llom Richard llom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Scilab-users] Call for reviewer <= SEP: upgrading weekday()

I find it confusing that only "DD/MM/YYYY" doesn't require a leading zero, while all others do...

Also there is no support at all for the us date format (MM/DD/YYYY). Not a fan of it, but users from the USA might appreciate it.

cheers
richard

Samuel GOUGEON wrote
Hello,

The new implementation of weekday() is now pushed and available on the
CodeReview:
https://codereview.scilab.org/#/c/19326/
Its updated help page is attached.

It now expects to be reviewed before merging. Any contributor is welcome
to do so online.
Thanks

Best regards
Samuel Gougeon
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Call for reviewer <= SEP: upgrading weekday()

Hello Richard,

Thanks for your input. I am answering in the body:

Le 01/08/2017 à 13:07, Richard llom a écrit :
> I find it confusing that only "DD/MM/YYYY" doesn't require a leading zero,
> while all others do...

Not all, just the YYYY-MM-DD... one, because this format is a
normalized/standard one.
As documented, the DD-Mmm-YYYY like "12-Feb-2031" or "7-Jun-2024" does nor
require any mandatory leading zero.

> Also there is no support at all for the us date format (MM/DD/YYYY). Not a
> fan of it, but users from the USA might appreciate it.

Then, for a big subset of dates, there would not be any way to
distinguish it from DD/MM/YYYY,
unless for instance using a distinct separator: MM\DD\YYYY. Not sure
that this would be actually ok.
Would it? IMO, a "US" optional flag would not be more handy.

Best regards
Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Richard llom Richard llom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Call for reviewer <= SEP: upgrading weekday()

> Then, for a big subset of dates, there would not be any way to
> distinguish it from DD/MM/YYYY,

Yeah, thats the problem with this format (and not only in scilab....).

> unless for instance using a distinct separator: MM\DD\YYYY. Not sure
> that this would be actually ok.
> Would it? IMO, a "US" optional flag would not be more handy.

IMO the "US" optional flag would be the only reasonable solution. Also for someone who has his source date in US-format, this optional flag would certainly be more handy than converting the date before / inline...

cheers
richard
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Call for reviewer <= SEP: upgrading weekday()

Le 01/08/2017 à 14:24, Richard llom a écrit :
>> unless for instance using a distinct separator: MM\DD\YYYY. Not sure
>> that this would be actually ok.
>> Would it? IMO, a "US" optional flag would not be more handy.
> IMO the "US" optional flag would be the only reasonable solution. Also for
> someone who has his source date in US-format, this optional flag would
> certainly be more handy than converting the date before / inline...

OK. So, instead of an option, we could use a prefix, that will be even
handier,
like in "US7/24/2017". It could be specified just with "US"+myDate
instead of myDate,"US",
without having to think about the place of the "US" option wrt the"long"
one.
We could use "US " (with a space) instead of "US", if a literal
readability is essential
(not my opinion). Anyway, the prefix must be fixed: either "US", xor "US ".
Any preference?

Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Richard llom Richard llom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Call for reviewer <= SEP: upgrading weekday()

> OK. So, instead of an option, we could use a prefix, that will be even
> handier, like in "US7/24/2017". It could be specified just with "US"+myDate
> instead of myDate,"US", without having to think about the place of the "US" option wrt the"long"
> one.
> We could use "US " (with a space) instead of "US", if a literal readability is essential
> (not my opinion). Anyway, the prefix must be fixed: either "US", xor "US ".
> Any preference?

But doesn't weekday also accept a matrix of strings? How would this work with the prefix?

I'm thinking more of data which is read-in (like from a log), and there a prefix isn't a reasonable solution, but maybe thats just me...

richard
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Call for reviewer <= SEP: upgrading weekday()

Le 01/08/2017 à 15:45, Richard llom a écrit :

>> OK. So, instead of an option, we could use a prefix, that will be even
>> handier, like in "US7/24/2017". It could be specified just with
>> "US"+myDate
>> instead of myDate,"US", without having to think about the place of the
>> "US" option wrt the"long"
>> one.
>> We could use "US " (with a space) instead of "US", if a literal
>> readability is essential
>> (not my opinion). Anyway, the prefix must be fixed: either "US", xor "US
>> ".
>> Any preference?
> But doesn't weekday also accept a matrix of strings? How would this work
> with the prefix?

As usual, in the same way, with "US" + myMatrixOfDates:

-->mydates = ["7/24/2017" "3/17/2015"];
-->"US"+mydates
  ans  =
!US7/24/2017  US3/17/2015  !

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Richard llom Richard llom
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Call for reviewer <= SEP: upgrading weekday()

Then I would go with just "US" (my opinion).

cheers
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Call for reviewer <= SEP: upgrading weekday()

In reply to this post by Richard llom
Le 01/08/2017 à 14:24, Richard llom a écrit :

>> Then, for a big subset of dates, there would not be any way to
>> distinguish it from DD/MM/YYYY,
> Yeah, thats the problem with this format (and not only in scilab....).
>
>> unless for instance using a distinct separator: MM\DD\YYYY. Not sure
>> that this would be actually ok.
>> Would it? IMO, a "US" optional flag would not be more handy.
> IMO the "US" optional flag would be the only reasonable solution. Also for
> someone who has his source date in US-format, this optional flag would
> certainly be more handy than converting the date before / inline...

Now dates prefixed with "en" (for "english") are accepted, like
"en09/17/2015".
Cheers
Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Loading...