2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: vBulletin bulk importer

This commit is contained in:
Régis Hanol 2017-07-24 14:22:00 +02:00
parent d9696c98c3
commit 57d6a5dc9c
2 changed files with 4 additions and 3 deletions

View file

@ -360,7 +360,8 @@ class BulkImport::VBulletin < BulkImport::Base
def parse_birthday(birthday)
return if birthday.blank?
date_of_birth = Date.strptime(birthday, "%m-%d-%Y")
date_of_birth = Date.strptime(birthday.gsub(/[^\d-]+/, ""), "%m-%d-%Y") rescue nil
return if date_of_birth.nil?
date_of_birth.year < 1904 ? Date.new(1904, date_of_birth.month, date_of_birth.day) : date_of_birth
end