Search code examples
datetimeorchardcmsglobalizationshapes

orchard cms - overriding date field shapes


For some problem in globalization( orchard cms built in datetime field) ,I need to change datetime related shapes in all existing modules, the shapes includes (I think):

  • Parts.Common.Date.Edit.cshtml
  • DateTimeRelative
  • DateTime

How can I change all of these shapes in all existing module? The changes are: adding some script to editor and some special formatting in other two shapes. And finally if I changes the above three shapes, then all date related input and display in all place in orchard site would be changed? I read lots of articles for doing this but i can't understand well.


Solution

  • The problem will be that those shapes are mostly in the admin. One thing you can do is take a dependency on the module defining them (in module.txt) so that your templates can take precedence. But changing the shapes probably won't be enough and you'll probably have to get your own driver in there to fix the dates on the way back. That being a little trickier, what I would probably do is handle all the locale-specific stuff in script on the client-side and send back to the server a date that has already been converted back to Gregorian calendar.