I have an editor template as following but class, maxlength and size attributes are not getting to the source.
@using System.Globalization
@model DateTime?
@Htm
Make sure your Editor template is named DateTime - placed in folder Views/Shared/EditorTemplates, and your model (Criteria.FormDate) is same type as EditorTemplate model (DateTime?).
If all DateTime fields will have same maxlength and size you can keep them hardcoded in your EditorTemplate. Example for your html:
@EditorFor(x => x.Criteria.FormDate) //no need to pass html attributes object if they are not used in the editor template
-- its worth trying @EditorFor(model, "EditorTemplateName")
to explicitly say you want that TemplateEditor for passed model. This is the case when you have multiple editors for same model type, so you call them explicitly(works like calling partial view and passing model to it).
EDIT: After looking at your template, it seems to me that your Criteria.FormDate is non nullable. You should look at improving/refactoring your code in template.