assistly/multipass-examples — pull request #7 by webervin (2012-08-31 07:13:02+00:00)
Title: using sample gives 500 to international customers.

Internaly MultiPass gem uses simple to_s if Date object is given, however this uses regional default and is sometimes non parsable by Desk.com server, giving 500 to our customers.

Time#to_s method will give correct date representation which is shown in example at http://dev.desk.com/docs/portal/multipass only in lucky environments who use iso as default format. If you are using Rails (and/or) somehow allow customers of your Rubyapplication possibility to change their date format to their preference things get worse.

Irb example:
irb(main):001:0> require 'time'
=> true
irb(main):002:0> t = Time.now
=> 2012-08-31 10:11:59 +0300
irb(main):003:0> t.to_s
=> "2012-08-31 10:11:59 +0300"
irb(main):004:0> t.iso8601
=> "2012-08-31T10:11:59+03:00"

Rails sample:
Time::DATE_FORMATS.merge! :default => "%d/%m/%Y %H:%M"
irb(main):009:0> t = Time.now
=> 2012-08-31 10:02:59 +0300
irb(main):010:0> t.to_s
=> "31/08/2012 10:02"
irb(main):011:0> t.iso8601
=> "2012-08-31T10:02:59+03:00"