Generate and render a :class:`django.forms.widgets.TextInput` for
        a single year, month, or day input.

        If size is specified in the extra attributes, it will also be used to
        set the maximum length of the field.

        :param name: base name of the input field
        :param field: pattern for this field (used with name to generate input name)
        :param value: initial value for the field
        :param extra_attrs: any extra widget attributes
        :returns: rendered HTML output for the text input

def create_textinput(self, name, field, value, **extra_attrs):
        '''Generate and render a :class:`django.forms.widgets.TextInput` for
        a single year, month, or day input.

        If size is specified in the extra attributes, it will also be used to
        set the maximum length of the field.

        :param name: base name of the input field
        :param field: pattern for this field (used with name to generate input name)
        :param value: initial value for the field
        :param extra_attrs: any extra widget attributes
        :returns: rendered HTML output for the text input
        '''
        # TODO: move id-generation logic out for re-use
        if 'id' in self.attrs:
            id_ = self.attrs['id']
        else:
            id_ = 'id_%s' % name

        # use size to set maximum length
        if 'size' in extra_attrs:
            extra_attrs['maxlength'] = extra_attrs['size']
        local_attrs = self.build_attrs(id=field % id_, **extra_attrs)
        txtinput = TextInput()
        return txtinput.render(field % name, value, local_attrs)