-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invalid date #43
Comments
Hi, we are using 3.4.2.stable with the same error, any idea? Thanks |
@deecay maybe something you can take a look at? This would be greatly appreciated |
I had the same problem. To fix it I had to change the language of my user from English to Portuguese/Brazil. |
Please see if this is resolved with current master. Thanks! |
Hi. Does not work if the custom date format is set. |
any idea how to fix it? |
Hi @marcin295 What version of Redmine and redmine_pivot_table version do you use? Do you use custom date format? If yes, what is the setting? |
Redmine: 3.4.2.stable |
Works fine for me with that configuration and date format. Can you paste the error output? The line numbers in the one in the original post is no longer valid. |
Ok, i see... That is another problem with queries not with dataFormat. Sorry.
|
Ok. So this is about other plugins you have (usability? a common libs?). Since I don't use those plugins, I'm afraid I cannot help. |
Fix for pivottables_helper.rb and incorrect date error. It's a dirty hack. I don't know if it will work for all, but in my particular case the problem was solved. Proper fix would require a "try except" (rescue) block around Date.strptime(column_content(c, i), strpformat) method call. How did I found the solution? By adding logging.
Output was
Note the last line. Field expiration_date (from some plugin) has value Expired in it. It's clearly not a valid date, so Date.strptime can't handle it. Quick and dirty fix is to add
As mentioned it's just a dirty hack, this problem should be fixed in a more appropriate way by. |
can u explain that? |
Started GET "/redmine/projects/bpsconnect-casino/pivottables" for 127.0.0.1 at 2017-11-04 17:43:30 +0800
Processing by PivottablesController#index as HTML
Parameters: {"project_id"=>"bpsconnect-casino"}
Current user: neo (id=1)
Rendered plugins/redmine_pivot_table/app/views/pivottables/index.html.erb within layouts/base (42.1ms)
Completed 500 Internal Server Error in 120ms (ActiveRecord: 23.5ms)
ActionView::Template::Error (invalid date):
57: <% if @table == "activity" %>
58: data = <%= raw parse_events(@events).to_json %>;
59: <% else %>
60: data = <%= raw parse_issues(@issues).to_json %>;
61: <% end %>
62:
63: var dateFormat = $.pivotUtilities.derivers.dateFormat;
plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:68:in
parse' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:68:in
block (2 levels) in parse_issues'plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:57:in
each' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:57:in
block in parse_issues'plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:55:in
each' plugins/redmine_pivot_table/app/helpers/pivottables_helper.rb:55:in
parse_issues'plugins/redmine_pivot_table/app/views/pivottables/index.html.erb:60:in
_plugins_redmine_pivot_table_app_views_pivottables_index_html_erb___789593742_75824952' lib/redmine/sudo_mode.rb:63:in
sudo_mode'The text was updated successfully, but these errors were encountered: