Added additional gaurd against empty strings for year, month, day.