diff --git a/django/forms/extras/widgets.py b/django/forms/extras/widgets.py
index 4fb4869..efac85f 100644
--- a/django/forms/extras/widgets.py
+++ b/django/forms/extras/widgets.py
@@ -16,25 +16,21 @@ __all__ = ('SelectDateWidget',)
 
 RE_DATE = re.compile(r'(\d{4})-(\d\d?)-(\d\d?)$')
 
-def _parse_date_fmt():
-    fmt = get_format('DATE_FORMAT')
-    escaped = False
-    output = []
-    for char in fmt:
-        if escaped:
-            escaped = False
-        elif char == '\\':
-            escaped = True
-        elif char in 'Yy':
-            output.append('year')
-            #if not self.first_select: self.first_select = 'year'
-        elif char in 'bEFMmNn':
-            output.append('month')
-            #if not self.first_select: self.first_select = 'month'
-        elif char in 'dj':
-            output.append('day')
-            #if not self.first_select: self.first_select = 'day'
-    return output
+
+def _parse_format(fmt=None):
+    """
+    Sort the order of date selectors according to the date_format attribute.
+    If date_format is not given, default to get_format('DATE_FORMAT')[0]
+    """
+    if not fmt:
+        return _parse_format(re.subn(r'\\.', '',
+                             get_format('DATE_INPUT_FORMATS')[0])[0])
+    def pos(s):
+        match = re.search('[' + s + ']', fmt)
+        return match.start() + 1 if match else 0
+    dic = {'day': pos('dj'), 'month': pos('bEFMmNn'), 'year': pos('yY')}
+    return sorted(filter(None, dic.keys()), key=dic.get)
+
 
 class SelectDateWidget(Widget):
     """
@@ -43,99 +39,102 @@ class SelectDateWidget(Widget):
     This also serves as an example of a Widget that has more than one HTML
     element and hence implements value_from_datadict.
     """
-    none_value = (0, '---')
-    month_field = '%s_month'
-    day_field = '%s_day'
-    year_field = '%s_year'
+    names = ('day', 'month', 'year',)
+    none_values_dafault = '---'
+    field_values = ['%s_' + n for n in names]
+    fields = dict(zip(names, field_values))
+    day_field, month_field, year_field = field_values
 
-    def __init__(self, attrs=None, years=None, required=True):
-        # years is an optional list/tuple of years to use in the "year" select box.
+    def __init__(self, attrs=None, years=None, required=True,
+            date_format=None, none_values=None):
+        # years is an optional list/tuple of years
+        # to use in the "year" select box.
         self.attrs = attrs or {}
         self.required = required
-        if years:
-            self.years = years
-        else:
+        if not years:
             this_year = datetime.date.today().year
-            self.years = range(this_year, this_year+10)
+            years = range(this_year, this_year + 10)
+        self.years = years
+        self.date_format = _parse_format(date_format)
+        self.none_values = none_values \
+            or dict([(i, self.none_values_dafault) for i in 'dmy'])
 
     def render(self, name, value, attrs=None):
+        get_names_dict = lambda l: dict(zip(self.names, l))
+
         try:
-            year_val, month_val, day_val = value.year, value.month, value.day
+            values_list = [getattr(value, n) for n in self.names]
         except AttributeError:
-            year_val = month_val = day_val = None
+            values_list = []
             if isinstance(value, basestring):
                 if settings.USE_L10N:
                     try:
                         input_format = get_format('DATE_INPUT_FORMATS')[0]
                         v = datetime.datetime.strptime(value, input_format)
-                        year_val, month_val, day_val = v.year, v.month, v.day
+                        values_list = [getattr(v, n) for n in self.names]
                     except ValueError:
                         pass
                 else:
                     match = RE_DATE.match(value)
                     if match:
-                        year_val, month_val, day_val = [int(v) for v in match.groups()]
-        choices = [(i, i) for i in self.years]
-        year_html = self.create_select(name, self.year_field, value, year_val, choices)
-        choices = MONTHS.items()
-        month_html = self.create_select(name, self.month_field, value, month_val, choices)
-        choices = [(i, i) for i in range(1, 32)]
-        day_html = self.create_select(name, self.day_field, value, day_val,  choices)
-
-        output = []
-        for field in _parse_date_fmt():
-            if field == 'year':
-                output.append(year_html)
-            elif field == 'month':
-                output.append(month_html)
-            elif field == 'day':
-                output.append(day_html)
+                        values_list = (int(v) for v in match.groups())
+        values = get_names_dict(values_list)
+
+        choices = get_names_dict([
+            [(i, i) for i in range(1, 32)],
+            MONTHS.items(),
+            [(i, i) for i in self.years],
+        ])
+        create_select_short = lambda n: self.create_select(
+            name, self.fields[n], value, values.get(n), choices[n], n
+        )
+
+        htmls = get_names_dict([create_select_short(n) for n in self.names])
+        date_format = self.date_format or self._parse_format()
+        output = [htmls[field] for field in date_format]
         return mark_safe(u'\n'.join(output))
 
-    def id_for_label(self, id_):
-        first_select = None
-        field_list = _parse_date_fmt()
+    def id_for_label(cls, id_):
+        field_list = _parse_format()
         if field_list:
             first_select = field_list[0]
-        if first_select is not None:
-            return '%s_%s' % (id_, first_select)
         else:
-            return '%s_month' % id_
+            first_select = 'month'
+        return '%s_%s' % (id_, first_select)
     id_for_label = classmethod(id_for_label)
 
     def value_from_datadict(self, data, files, name):
-        y = data.get(self.year_field % name)
-        m = data.get(self.month_field % name)
-        d = data.get(self.day_field % name)
+        d, m, y = (data.get(self.fields[n] % name) for n in self.names)
         if y == m == d == "0":
             return None
-        if y and m and d:
-            if settings.USE_L10N:
-                input_format = get_format('DATE_INPUT_FORMATS')[0]
-                try:
-                    date_value = datetime.date(int(y), int(m), int(d))
-                except ValueError:
-                    return '%s-%s-%s' % (y, m, d)
-                else:
-                    date_value = datetime_safe.new_date(date_value)
-                    return date_value.strftime(input_format)
-            else:
-                return '%s-%s-%s' % (y, m, d)
-        return data.get(name, None)
+        if not (y and m and d):
+            return data.get(name)
+        if not settings.USE_L10N:
+            return '%s-%s-%s' % (y, m, d)
+        input_format = get_format('DATE_INPUT_FORMATS')[0]
+        try:
+            date_value = datetime.date(int(y), int(m), int(d))
+            date_value = datetime_safe.new_date(date_value)
+            return date_value.strftime(input_format)
+        except ValueError:
+            return '%s-%s-%s' % (y, m, d)
 
-    def create_select(self, name, field, value, val, choices):
+    def create_select(self, name, field, value, val, choices, date_part='d'):
         if 'id' in self.attrs:
             id_ = self.attrs['id']
         else:
             id_ = 'id_%s' % name
         if not (self.required and val):
-            choices.insert(0, self.none_value)
+            choices.insert(0, (0, self.none_values[date_part[0]]))
         local_attrs = self.build_attrs(id=field % id_)
         s = Select(choices=choices)
         select_html = s.render(field % name, val, local_attrs)
         return select_html
 
     def _has_changed(self, initial, data):
-        input_format = get_format('DATE_INPUT_FORMATS')[0]
-        data = datetime_safe.datetime.strptime(data, input_format).date()
-        return super(SelectDateWidget, self)._has_changed(initial, data)
\ No newline at end of file
+        try:
+            input_format = get_format('DATE_INPUT_FORMATS')[0]
+            data = datetime_safe.datetime.strptime(data, input_format).date()
+        except (TypeError, ValueError):
+            pass
+        return super(SelectDateWidget, self)._has_changed(initial, data)
