Closed peterfication closed 7 years ago
I encountered the problem today, that Gmail rejected my queries with dates (on, before, after) and after some digging I found the problem in the wrong implementation of the to_imap_date function.
on
before
after
to_imap_date
As http://www.ietf.org/rfc/rfc3501.txt states the date format is
... date = date-text / DQUOTE date-text DQUOE ... date-text = date-day "-" date-month "-" date-year ... date-month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec" ...
The implementation in the gem here uses %B, hence the full month names. However, it should use %b for the short month names.
%B
%b
I can fix this in my project by adding this snippet in my code:
class Object def to_imap_date date = respond_to?(:utc) ? utc.to_s : to_s Date.parse(date).strftime('%d-%b-%Y') end end
Works for me. Thank you!
Works for me too. thanks so much
IT Works ! thank you very much!
Thank you! It works!
Thanks!
I encountered the problem today, that Gmail rejected my queries with dates (
on
,before
,after
) and after some digging I found the problem in the wrong implementation of theto_imap_date
function.As http://www.ietf.org/rfc/rfc3501.txt states the date format is
The implementation in the gem here uses
%B
, hence the full month names. However, it should use%b
for the short month names.I can fix this in my project by adding this snippet in my code: