'DateTime' field handling issue in 1.8.1

Topics: Core, General
Jul 22, 2014 at 6:25 AM
after converting from 1.7 to 1.8.1 I still (or again) have subject issue (1.7 issue see: Wiki Link: [discussion:400907] ). Because it looks slightly different I open again an issue for 1.8.1.

When using the 'DateTime' field (defined as date only!) the time is always set as 12 mid-day!
see below record(it shows correctly 10:00 because I'm on summertime and GMT+1):

Orchard_Framework_ContentItemVersionRecord: <dateend>2014-07-21T10:00:00.0000000Z</dateend> -->(24h!)

When using this 'DateTime' field in a query the day is gone at noon that day !!!!!
PS: that this 10:00 is on 24h I only figured by testing! I helped myself by using now the time field to force 24:00 in using 11:59 PM!

Also I found that Ican only enter the time using the A/PM form?!

  • is there anything I need to change in Orchard/System around the time business to change this behaviour?
  • is it possible to change the entry to the 24h form? Thanks for your time and hints
Thanks for your time and advise
Jul 22, 2014 at 8:05 AM
Edited Jul 22, 2014 at 8:05 AM
The format of the date is based on the Culture and it uses a javascript plugin to edit the date.

You should have a culture selected and the corresponding ressource files copied in your structure.
See https://crowdin.net/project/orchard-cms if you want to retrieve some .po files.

Ex in French : The ressource to localize the time looks like this in Core\App_Data\Localization\fr-FR\orchard.core.po
#: Orchard.Core.Shapes.Localization.DateTimeLocalization
#| msgid "h:mm tt"
msgctxt "Orchard.Core.Shapes.Localization.DateTimeLocalization"
msgid "h:mm tt"
msgstr "HH:mm"
Jul 22, 2014 at 3:11 PM
Hi, thanks for your time

yes I admit I didn't ad the culture on this test site ... my apology ... i have done it now and I think
there is still the same issue (PS: I have several sites with the culture set correctly, and yes the .po file is like you show in your answer)

may I kindly ask you to read my first msg again - mainly the third line(quote below):

"When using the 'DateTime' field (defined as date only!) the time is always set as 12 mid-day!"

When I test now with the culture set I still get ..T10:00 ... !
This does NOT make sense at all because when using it in a query the day ends at 1200 (24h) and the query correctly cuts those records off!

By the way: with the culture set I still can enter the time only in AM/PM format!!?

I'm far away from saying that this is a SW error -- I'm happy to get any advise

thanks again for your time
Jul 23, 2014 at 7:29 AM
Hi Jasper,
thanks ... I opened a bug '20821'
PS: where do I find DefaultDataService? I might have some time to check ....!

As far as the date format is concerned I figured that the Module 'Data/Time Format Localization' was 'activated'? After 'desactivation' all was fine?

  • what for is this module used?
  • when should it be activated/de-activated?
  • how is it involved in the culture business?
    thanks again for your help, ed
Jul 23, 2014 at 1:30 PM
Edited Jul 23, 2014 at 2:29 PM
Hi Jasper,
thanks that's clears it all!
I'm using mostly fr-FR and sometimes de-CH (however when de-CH I can as well use English .. !). Therefore in FR I had the mixup!

update: one thing I still can't achieve: How do I add a time like 2400! or for that matter 0000!
using 24:00: is not accepted
using 0000: makes GMT+2 22:00 but on the previous day - crazy!!
PS: this needs some more testing!?

thanks again for your time, ed
Jul 23, 2014 at 2:25 PM
The 12:00 issue sounds like a bug indeed. I have assigned the work item to me and will investigate.
Jul 23, 2014 at 7:24 PM
Let's continue discussion in the work item https://orchard.codeplex.com/workitem/20821. I have just posted a comment there.