[open-ils-commits] [GIT] Evergreen ILS branch rel_2_3 updated. 63fcae2a0961ee9e0a4b516b678daccf9f7c9fc3

Evergreen Git git at git.evergreen-ils.org
Tue Oct 9 14:04:16 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, rel_2_3 has been updated
       via  63fcae2a0961ee9e0a4b516b678daccf9f7c9fc3 (commit)
      from  465488439e75bbb9bc9fbbba0e23c0036cf9937d (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 63fcae2a0961ee9e0a4b516b678daccf9f7c9fc3
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 902a4e0..9f0f27a 100644
--- a/Open-ILS/src/c-apps/oils_sql.c
+++ b/Open-ILS/src/c-apps/oils_sql.c
@@ -6428,10 +6428,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 ));
@@ -6514,10 +6514,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