From: simonbrandhof Date: Fri, 29 Apr 2011 13:18:22 +0000 (+0200) Subject: deprecate methods parse_datetime and format_datetime of Api::ApiController X-Git-Tag: 2.8~70 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f0354f9fd3c376636338f471bcbd0db1f7813ad8;p=sonarqube.git deprecate methods parse_datetime and format_datetime of Api::ApiController --- 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