0

I need to have in my fields a datetime content type. Looking for documentation I found same here http://2sxc.org/en/Docs-Manuals/Feature/feature/2874

Date and Time no relevant settings to explain. Note that the output-template will usually choose to show only the date, only the time etc. So it's the same data-field no matter what you're actually entering.

How can I set a default date value like a Datetime.Now for the editing input data field? I tryed with varius commands but it gives me invalid date. I alsa tryed the dnn token [DateTime: Now] but it doesn't work. Thanks

1 Answers1

0

To prefil the date-time there are two options

  1. the link in the dnn-page which creates a new-item could pass this in as a prefill - http://2sxc.org/en/Docs-Manuals/Prefill-new-Forms

  2. there is a hidden API which could do it using JavaScript, but it's not official yet, fairly technical and still prone to change. So I would use #1

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21
  • Sorry, i wouldn't mean prefill the value, I would like to have a default date in the editor form for that content. So that the editor can ignore it or change it.. Like in the screen https://snag.gy/3XxKWz.jpg – Giovanni Manzo Oct 11 '16 at 12:30
  • In the config-dialog there is no way to do this as of now, except for the hidden API. The prefill would achieve the same effect though, but you would do it where you create the "add" button, not in the field-configuration. – iJungleBoy Oct 12 '16 at 15:38
  • Ok thanks you, It would be nice in the future to do so directly in the config dialog, do you think that it is possible? – Giovanni Manzo Oct 12 '16 at 18:59
  • @GiovanniManzo it's technically already possible with a hidden javascript-field :) We just haven't documented it yet, because we always want to use it for a while to see what problems arise, before we share it (and cause too much suffering :). if you're really keen on trying it at your own risk, I'll tell you how :) – iJungleBoy Oct 12 '16 at 21:32
  • Thanks you very much, but it's just about a month that I'm on dnn and 2sxc, so I'm already trying to learn it and I still have too many things that I have to work on to finish my first "complex" app. I will wait for a stable version and I will use the prefill way for now ;) – Giovanni Manzo Oct 13 '16 at 09:37