I have a requirement to show the default time for eg 12:00 Am in the date-time component when the page gets loaded.
Date should be blank .
Discussion posts and replies are publicly visible
Where is the "page" and what is it doing? Is this a form where a user will be able to make edits, or display-only? The way you would pre-populate such data depends on these details you didn't include.
thank you for your quick response. Yes, we allow users to edit this date-time field. we have this field in the form
Then in your process flow prior to reaching the form, use a script task to prepopulate the PV with the data you want, prior to passing it into the SAIL form in the user input task node.
how can I pass in time, not date in PV? can you give me a sample?
Oh, sorry I didn't notice that piece of the requirement before. Basically you can't. You can either set the date and time, or leave it blank. The date/time data type cannot hold a time without a date.
yes, the requirement is to have the default time set to 12 am on the date-time field.
Even we cannot populate time when a user enters date alone.
Does the user need to be able to change the time? If so then you'll be stuck either populating both the date and time, or populating neither. If the user *doesn't* need to be able to change the time, then you could just use a DateField and display "12:00 PM" nearby in some sort of read-only text.
yes, the user wants to change the time. We will let our business know it is not possible to do so. Thank you
Similar to what Mike noted, you can always use a combination of 2 fields with a!sideBySideLayout(). Date field (no default) for the date portion, then a text field with validation, or dropdown, etc for the time field - combine back together during save from local variables into your CDT.
a!localVariables( local!date: null, local!time: "12:00 AM", a!sideBySideLayout( items: { a!sideBySideItem( width: "MINIMIZE", item: a!dateField( label: "Date", value: local!date, saveInto: local!date ) ), a!sideBySideItem( width: "MINIMIZE", item: a!textField( label: "Time", value: local!time, saveInto: local!time ) ) } ) )
yes, I agree, we can have a text field with validation. and finally, convert into date-time value.