[open-ils-commits] [GIT] Evergreen ILS branch master updated. 0c07adf3290c15647d958fd42524929224bd3b39

Evergreen Git git at git.evergreen-ils.org
Tue Oct 9 14:03:57 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  0c07adf3290c15647d958fd42524929224bd3b39 (commit)
      from  1cb6a1ebb36d44985feca77d10c1848b838bd275 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0c07adf3290c15647d958fd42524929224bd3b39
Author: Mike Rylander <mrylander at gmail.com>
Date:   Mon Oct 8 14:12:49 2012 -0400

    Be more strict about dates we generate
    
    ISO-8601 dates must have a 4-character year component, however strftime does
    not left-pad years to 4 characters when the century is one character long even
    though the man page for strftime(3) suggests otherwise:
    
           %F     Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99)
    
    This makes stricter ISO-8601 parsers, such as Perl's DateTime module, unhappy.
    So, we'll do it ourselves using the glibc extensions available to strftime for
    specifying a padding character and desired length.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/c-apps/oils_sql.c b/Open-ILS/src/c-apps/oils_sql.c
index c9c1618..5c93b29 100644
--- a/Open-ILS/src/c-apps/oils_sql.c
+++ b/Open-ILS/src/c-apps/oils_sql.c
@@ -6436,10 +6436,10 @@ static jsonObject* oilsMakeFieldmapperFromResult( dbi_result result, osrfHash* m
 						strftime( dt_string, sizeof( dt_string ), "%T", &gmdt );
 					} else if( !( attr & DBI_DATETIME_TIME )) {
 						localtime_r( &_tmp_dt, &gmdt );
-						strftime( dt_string, sizeof( dt_string ), "%F", &gmdt );
+						strftime( dt_string, sizeof( dt_string ), "%04Y-%m-%d", &gmdt );
 					} else {
 						localtime_r( &_tmp_dt, &gmdt );
-						strftime( dt_string, sizeof( dt_string ), "%FT%T%z", &gmdt );
+						strftime( dt_string, sizeof( dt_string ), "%04Y-%m-%dT%T%z", &gmdt );
 					}
 
 					jsonObjectSetIndex( object, fmIndex, jsonNewObject( dt_string ));
@@ -6522,10 +6522,10 @@ static jsonObject* oilsMakeJSONFromResult( dbi_result result ) {
 						strftime( dt_string, sizeof( dt_string ), "%T", &gmdt );
 					} else if( !( attr & DBI_DATETIME_TIME )) {
 						localtime_r( &_tmp_dt, &gmdt );
-						strftime( dt_string, sizeof( dt_string ), "%F", &gmdt );
+						strftime( dt_string, sizeof( dt_string ), "%04Y-%m-%d", &gmdt );
 					} else {
 						localtime_r( &_tmp_dt, &gmdt );
-						strftime( dt_string, sizeof( dt_string ), "%FT%T%z", &gmdt );
+						strftime( dt_string, sizeof( dt_string ), "%04Y-%m-%dT%T%z", &gmdt );
 					}
 
 					jsonObjectSetKey( object, columnName, jsonNewObject( dt_string ));

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/c-apps/oils_sql.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list