2

I am facing difficulty in displaying date field. It is not allowing me to send space in the format parameter. For example if I use below code:

@Html.Sitecore().Field(Value_of_the_datetime field, new {format="MMM dd, yyyy"})

In the output it shows month only.

But if I choose a format like "MMMddyyyy"(basically without any space), it shows the full value.

Does anybody know how this issue can be resolved?

3
  • Are you sure it's not a styling issue? Have you checked the source of the page? Mar 17 '20 at 9:28
  • No Marek, this issue is more like a bug which might not have been in previous versions but it is in 9.3 for sure. Faced this issue while completing the training material and now in the project itself. Mar 17 '20 at 9:39
  • Indeed, I reproduced the same after upgrade 8.2 => 9.3. In would be nice to understand the root cause of this issue. Jun 10 '20 at 21:23
4

You should try the format like below -

@Html.Sitecore().Field(datefield, new {format="MMM\ndd,\nyyyy"})

Hopefully, this is will work for you.

1
  • You are awesome, thanks for your quick reply Mar 17 '20 at 9:29
1

It's a known issue starting from 9.3. The reference number you can provide Support with is 421731.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.