From f0354f9fd3c376636338f471bcbd0db1f7813ad8 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Fri, 29 Apr 2011 15:18:22 +0200 Subject: [PATCH] deprecate methods parse_datetime and format_datetime of Api::ApiController --- .../WEB-INF/app/controllers/api/api_controller.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/api_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/api_controller.rb index 709b7d103fe..594635c62a1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/api_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/api_controller.rb @@ -77,16 +77,15 @@ class Api::ApiController < ApplicationController def render_success(msg) render_error(msg, 200) end - + + # deprecated. Use Api::Utils.format_datetime def format_datetime(datetime) - datetime.strftime("%Y-%m-%dT%H:%M:%S%z") + Api::Utils.format_datetime(datetime) end - + + # deprecated. Use Api::Utils.parse_datetime def parse_datetime(datetime_string, default_is_now=true) - if datetime_string.blank? - return (default_is_now ? Time.now : nil) - end - Time.parse(datetime_string) + Api::Utils.parse_datetime(datetime_string, default_is_now) end class ApiException < Exception -- 2.39.5