[grilo-plugins] steam-store: fix iso8601 conversion



commit 50095364a5a04b5bec018cc5650f199e7779aaa1
Author: Victor Toso <me victortoso com>
Date:   Mon Feb 17 17:07:22 2020 +0100

    steam-store: fix iso8601 conversion
    
    The format must be YYYY-MM-DD but current string.format could return
    single digit month or day.
    
    I notice this while porting in grilo's grl_date_time_from_iso8601() to
    use g_date_time_new_from_iso8601() in oppose to deprecated
    g_time_val_from_iso8601().
    
    Hooray for unit tests!

 src/lua-factory/sources/grl-steam-store.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/lua-factory/sources/grl-steam-store.lua b/src/lua-factory/sources/grl-steam-store.lua
index 2bab40f7..d87ed4bc 100644
--- a/src/lua-factory/sources/grl-steam-store.lua
+++ b/src/lua-factory/sources/grl-steam-store.lua
@@ -91,7 +91,7 @@ function format_date(date)
     return nil
   end
 
-  return string.format("%d-%d-%d", year, month_map[month], day)
+  return string.format("%d-%02d-%02d", year, month_map[month], day)
 end
 
 function fetch_game_cb(results, appid)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]