diff --git a/lib/package.gi b/lib/package.gi index 96b341cd26..226dba4014 100644 --- a/lib/package.gi +++ b/lib/package.gi @@ -2677,7 +2677,7 @@ Unicode:= "dummy"; Encode:= "dummy"; InstallGlobalFunction( BibEntry, function( arg ) - local key, pkgname, pkginfo, GAP, ps, months, val, entry, author; + local key, pkgname, pkginfo, GAP, ps, val, entry, author; key:= false; if Length( arg ) = 1 and IsString( arg[1] ) then @@ -2771,13 +2771,11 @@ InstallGlobalFunction( BibEntry, function( arg ) # We put the version information into the title component since # the edition component is not supported in the base styles. - months:= [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; if GAP then val:= SplitString( GAPInfo.Date, "-" ); if Length( val ) = 3 then if Int( val[2] ) in [ 1 .. 12 ] then - val:= Concatenation( " ", months[ Int( val[2] ) ], + val:= Concatenation( " ", NameMonth[ Int( val[2] ) ], "\n ", val[1], "\n" ); else val:= Concatenation( " ", val[2], @@ -2831,7 +2829,7 @@ InstallGlobalFunction( BibEntry, function( arg ) and Length( pkginfo.Date ) = 10 then if Int( pkginfo.Date{ [ 4, 5 ] } ) in [ 1 .. 12 ] then Append( entry, Concatenation( - " ", months[ Int( pkginfo.Date{ [ 4, 5 ] } ) ], + " ", NameMonth[ Int( pkginfo.Date{ [ 4, 5 ] } ) ], "\n", " ", pkginfo.Date{ [ 7 .. 10 ] }, "\n" ) ); else diff --git a/src/version.c.in b/src/version.c.in index 3d7632b2f3..15b5bd6d90 100644 --- a/src/version.c.in +++ b/src/version.c.in @@ -26,7 +26,7 @@ const char * SyKernelVersion = "@GAP_VERSION@"; ** *V SyReleaseDay . . . . . . . . . . . . . . release date of this GAP version ** -** 'SyReleaseDay' is the date of the release, e.g. "19-Jun-2019"; for +** 'SyReleaseDay' is the date of the release, e.g. "2019-Jun-19"; for ** development versions, this is set to "today". */ const char * SyReleaseDay = "@GAP_RELEASEDAY@"; diff --git a/src/version.h.in b/src/version.h.in index 4c73687b7a..ced22cc7b7 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -77,7 +77,7 @@ extern const char * SyKernelVersion; ** *V SyReleaseDay . . . . . . . . . . . . . . release date of this GAP version ** -** 'SyReleaseDay' is the date of the release, e.g. "19-Jun-2019"; for +** 'SyReleaseDay' is the date of the release, e.g. "2019-Jun-19"; for ** development versions, this is set to "today". */ extern const char * SyReleaseDay; diff --git a/tst/testinstall/package.tst b/tst/testinstall/package.tst index 6451fefc9b..9de7e079c3 100644 --- a/tst/testinstall/package.tst +++ b/tst/testinstall/package.tst @@ -1,4 +1,4 @@ -#@local entry,equ,pair,sml,oldTermEncoding,pkginfo,info,tmp_dir,mockpkgpath,old_warning_level,p,n,filename +#@local entry,equ,pair,sml,oldTermEncoding,pkginfo,info,tmp_dir,mockpkgpath,old_warning_level,p,n,filename,IsDateFormatValid gap> START_TEST("package.tst"); # CompareVersionNumbers( , [, \"equal\"] ) @@ -516,6 +516,21 @@ new methods: mockpkg_Property( ... )* +# Cite() expects GAPInfo.Date to be of the form "YYYY-MM-DD" or "YYYY-Mon-DD" (or "today") +gap> IsDateFormatValid := function( datestring ) +> local val; +> if datestring = "today" then +> return true; +> fi; +> val:= SplitString( datestring, "-" ); +> if Length( val ) <> 3 then +> return false; +> fi; +> return Int( val[1] ) in [ 1900 .. 2100 ] and ( val[2] in NameMonth or Int( val[2] ) in [ 1 .. 12 ] ) and Int( val[3] ) in [ 1 .. 31 ]; +> end;; +gap> IsDateFormatValid( GAPInfo.Date ); +true + # Test the Cite() command (output changed with GAPDoc 1.6.6 and again with 1.6.7) #@if CompareVersionNumbers(InstalledPackageVersion("gapdoc"), "1.6.7") gap> Cite("mockpkg");