Option "now" and format for reading #41

Closed
serval92 opened this Issue Jan 31, 2014 · 7 comments

Projects

None yet

2 participants

@serval92

Hi Wvega.

Thank you for your script. It's very useful.
Can i suggest you to add a "now" option, which takes the server hour by default ?
By format for reading, I mean that you read for example "14h00" on the screen, and the time is recorded to "14:00:00"...
Thank you again.

@wvega
Owner
wvega commented Jan 31, 2014

Hi @serval92,

I have considered the format for reading option myself, so I'm interest in adding it.

Could you please explain how you would use the now option, or how do you expect it to affect the Timepicker's behaviour?

@serval92

Hi Wvega.
Thanks for the reply.
I imagine that :
you add this option in script : now:1
And if your computer hour (or server hour) is 08h12, the time by default in the field is 08:12:00...
Thank you.

@serval92 serval92 closed this Jan 31, 2014
@serval92 serval92 reopened this Jan 31, 2014
@wvega wvega added a commit that referenced this issue Feb 15, 2014
@wvega Add defaultTime option (#41). 06ef619
@wvega
Owner
wvega commented Feb 15, 2014

Hi @serval92,

I added a defaultTime option that you can use to define a default value for the time field. You can pass a value as:

  1. A time string. Passing '8:12' will update the field to have the value 08:12 PM (with the default format).
  2. A Date object.
  3. The string 'now', which will use the current time in the users's computer.

If you want to use the server time, you will have to generate that value yourself using code in the backend, and then providing that value as the defaultTime option of the Timepicker. Please take into account that your server time and the user's time may be in different timezones.

Do you think the defaultTime I described above covers what you wanted to achieve with the now option?

@wvega
Owner
wvega commented Feb 15, 2014

I'll add a separated issue for the format for reading option. I need to find the right way to implement that feature.

@serval92

Hi wvega.

Thank you so much for your job.
It's exactly what I wanted.
Thank you again.

@wvega
Owner
wvega commented Feb 17, 2014

Great. Those changes are not available in a new version yet, but you can have access to them downloading a copy of the plugin from the development branch: https://github.com/wvega/timepicker/tree/devel.

I'll try to do a release soon.

@wvega wvega closed this Feb 17, 2014
@serval92

Thank you Willington.

2014-02-17 16:56 GMT+01:00 Willington Vega notifications@github.com:

Great. Those changes are not available in a new version yet, but you can
have access to them downloading a copy of the plugin from the development
branch: https://github.com/wvega/timepicker/tree/devel.

I'll try to do a release soon.

Reply to this email directly or view it on GitHubhttps://github.com/wvega/timepicker/issues/41#issuecomment-35296345
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment