Skip to content
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

redmine.exceptions.ValidationError: Date is not a valid date #11

Open
jhagberg opened this issue Feb 11, 2015 · 6 comments
Open

redmine.exceptions.ValidationError: Date is not a valid date #11

jhagberg opened this issue Feb 11, 2015 · 6 comments
Labels

Comments

@jhagberg
Copy link

Trying to sync and get this error

./redminetimesync.py 2
Sync tasks for 09/02/15 ?

Press ENTER to validate ... 


-> Connecting to Redmine...  OK 

* [8.0h #1705]: #1705


Total : 8.0h

Press ENTER to synchronize those tasks ... 

-> Sending entries .
Traceback (most recent call last):
  File "./redminetimesync.py", line 281, in 
    syncToRedmine(time_entries, date, redmine)
  File "./redminetimesync.py", line 169, in syncToRedmine
    comments=time_entry_infos['comment']
  File "/usr/local/lib/python2.7/dist-packages/redmine/managers.py", line 180, in create
    response = self.redmine.request('post', url, data=data)
  File "/usr/local/lib/python2.7/dist-packages/redmine/__init__.py", line 143, in request
    raise ValidationError(to_string(', '.join(e if is_string(e) else ': '.join(e) for e in errors)))
redmine.exceptions.ValidationError: Date is not a valid date
@jhagberg
Copy link
Author

changing
in syncToRedmine
and add strftime like this
spent_on=date.date.strftime("%Y-%m-%d"),

Fixed this error

@brunetton
Copy link
Owner

I never experimented any errors like that one 😕

Could you give me the Redmine version you're using ?

Thanks

@jhagberg
Copy link
Author

  Redmine version                2.5.2.stable.13345
  Ruby version                   1.9.3-p125 (2012-02-16) [x86_64-linux]
  Rails version                  3.2.19
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Subversion                     1.6.11
  Git                            1.7.1
  Filesystem                     
Redmine plugins:
  redmine_anonymous_authors      0.0.4
  redmine_anonymous_watchers     0.1.0
  redmine_custom_help_url        0.0.2
  redmine_projects_accordion     0.1.0
  redmine_spent_time             2.6.6
  redmine_timetables             0.0.1
  redmine_unassigned_issues      0.0.1

@samuell
Copy link

samuell commented Feb 23, 2015

I wonder if it is anything with the default date format in the locale settings of the operating system, that makes it occur only for us who has something different than MM/DD/YY ?

@lo0m
Copy link

lo0m commented Aug 10, 2015

thx @jhagberg , that worked OK.
I've experienced this on debian with czech locale connecting to redmine 2.6.0.stable with czech lang used systemwide if that makes any difference

@barnaba
Copy link

barnaba commented Jul 26, 2016

spent_on=date.date.strftime("%Y-%m-%d"),

Alternatively date.date.date().

brunetton added a commit that referenced this issue Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants