diff --git a/plugins/mezuro/public/javascripts/project_content.js b/plugins/mezuro/public/javascripts/project_content.js index 1b87c70..ca9d64b 100644 --- a/plugins/mezuro/public/javascripts/project_content.js +++ b/plugins/mezuro/public/javascripts/project_content.js @@ -51,23 +51,14 @@ function reloadModule(){ return false; } -function reloadProjectWithDate(){ - var day = jQuery("#project_date_day").val(); - var month = jQuery("#project_date_month").val(); - var year = jQuery("#project_date_year").val(); - - if(day.length == 1) - day = "0" + day; - if(month.length == 1) - month = "0" + month; +function reloadProjectWithDate(date){ + var new_date = new Date(date + "T00:00:00+00:00"); - var date = new Date(year + "-" + month + "-" + day + "T00:00:00+00:00"); - - if(isNaN(date)){ - alert("Invalid date! " + date); + if(isNaN(new_date)){ + alert("Invalid date! " + new_date); return false; } - reloadProject(date); + reloadProject(new_date); return false; } diff --git a/plugins/mezuro/views/content_viewer/_project_result.rhtml b/plugins/mezuro/views/content_viewer/_project_result.rhtml index 126c7b7..a8b51be 100644 --- a/plugins/mezuro/views/content_viewer/_project_result.rhtml +++ b/plugins/mezuro/views/content_viewer/_project_result.rhtml @@ -1,36 +1,7 @@ <% unless @content.errors[:base].nil? %> <%= @content.errors[:base] %> <% else %> - <% form_for :project_date, :html=>{:id=>"project_history_date"} do |f| %> - <%= f.label :day, "Choose project date:" %> - -
- Day - | -- Month - | -- Year - | -
- <%= f.text_field :day, :size => 1, :maxlength => 2, :placeholder =>"dd" %> - | -- <%= f.text_field :month, :size => 1, :maxlength => 2, :placeholder =>"mm" %> - | -- <%= f.text_field :year, :size => 1, :maxlength => 4, :placeholder =>"yyyy" %> - | -
Choose a date to see specific project results: