Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default date / time #164

Open
ajb opened this issue May 1, 2016 · 1 comment
Open

Set default date / time #164

ajb opened this issue May 1, 2016 · 1 comment

Comments

@ajb
Copy link

ajb commented May 1, 2016

First off, thanks for the great library!

I'm writing on behalf of @jrubenoff (in dobtco/dispatch#42), who asks: is there a configuration option for setting the default time to a certain hour of the day (e.g. 12am) instead of defaulting to the current time?

If not, would you be open to a PR? I could probably use a pointer to where in the code I should be looking, too.

Thanks for your time!

@qmarcos
Copy link

qmarcos commented Nov 28, 2018

Yes, for example through setValue method.

var cal = rome(input);

// for example tomorrow at 8:00 AM through moment.js
var tomorrowat8am = moment().startOf('day').add(1, 'days').add(8, 'hours');

cal.setValue(tomorrowat8am);

Set value can receive different kind of formats, from the docs:

Forces a refresh of the calendar. This method will redraw the month and update the dates that can be selected in accordance with dateValidator and timeValidator.

Hope it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants