How to change the setting of DialogComponentDate or DateInputDialog?

i am using DialogComponentDate now but i want to show the date and hide the time part.

I also want to set default date as current date, where i can config those features ? Because i can’t set in SettingsModelDate.

Then i tried to use DateInputDialog and i found

new DateInputDialog(DateInputDialog.Mode. NOTIME );

which fit my need. But how this work with addDialogComponent()? because i don’t know how to put this on my panel like cast to DialogComponent. Thank you

Hi @eaton1632,

Have you looked into org.knime.time.util.DialogComponentDateTimeSelection? This is the new dialog component which was used in the new Date&Time nodes. There you can set the DisplayOption to SHOW_DATE_ONLY. If you want to have the current date set when opening the dialog, you need to specify this during loading the dialog settings.


1 Like

Did not find the class DialogComponentDateTimeSelection in
and in Eclipse SDK


I use SettingsModelDate and set the default time with the following code,but not work

protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
	 * Load (valid) settings from the NodeSettings object. It can be safely assumed that
	 * the settings are validated by the method below.
	 * The SettingsModel will handle the loading. After this call, the current value
	 * (from the view) can be retrieved from the settings model.
	startDateSettings.setTimeInMillis(new Date().getTime());

Hi @lou,

It’s this class:
Did you setup the sdk correctly? Follow the instructions here .

What does not work?


My sdk version is

Not work:the date component default did not update with my init value.


The class is in knime-base, not in knime-core.

You are loading the settings after you have set the value, i.e., you overwrite your value by loading the settings. I think that’s the issue.

According to the document did not find how to import the knime-base jar

You mean set the default date must within which method?

You don’t need any jar at all. All you need is to set the target platform as described there. The target platform brings all these dependencies and you will be able to use the DialogComponentDateTimeSelection class.

Did you take a look at this blog post or at this documentation They might help you to understand how to work with default dialog components.


1 Like

thanks i will try reload target platform.
by the way,could you give me some suggestion on how to set the init date on


I set the init date value within configure method

protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
	startTimeSetting.setTimeInMillis(new Date().getTime());
	endTimeSetting.setTimeInMillis(new Date().getTime());
	return new DataTableSpec[] { null };

but open configure dialog the init date always 1970-01-01


Where is the API DOC?

I changed the target to target-complete and core-base.jar is in the dependency,but class
not found.


The API documentation is in the code. It is open source, so you can just have a look at it. I don’t think we have a website which lists the API.

Hard to guess what the problem is. The only advice I can give is to double check that you didn’t skip any of the steps in the instruction and that all the dependencies are correctly set up.

1 Like

there is not org.knime.time package in my project knime-base jar


Here is the solution knime-base.jar not including all source code at github