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

Time editing via input field #55

Closed
jbthomps opened this issue Oct 23, 2018 · 22 comments
Closed

Time editing via input field #55

jbthomps opened this issue Oct 23, 2018 · 22 comments

Comments

@jbthomps
Copy link

My users expect to be able to edit the time within the input control itself to support full keyboard accessibility without having to enter the timepicker itself. In other components, the timepicker/datepicker either had this functionality natively, usually also only allowing open by provided icon, or was exposed as a service, which allowed for the developer to combine timepicker access with a native component, usually by adding an icon button.

If it's possible, if it needs to be bound to an input, it would help to be able to be combined with input type="time", or to provide a directive that acts as a time mask over a standard input, but neither of these are strictly needed.

@Agranom
Copy link
Owner

Agranom commented Oct 24, 2018

Do you mean edit time through the input without opening the timepicker?

@jbthomps
Copy link
Author

That is exactly what I mean.

@Agranom
Copy link
Owner

Agranom commented Oct 30, 2018

I'll do something with it

@Dona278
Copy link

Dona278 commented Nov 1, 2018

@Agranom could you estimate the date to get this feature? However, congrats for this awesome work

@Agranom
Copy link
Owner

Agranom commented Nov 1, 2018

I have to fix other issues first, so it could be a few weeks, but I'm not sure. However, I'll try to implement it as soon as possible

@Aidan-Chey
Copy link

This reads like what I have just implemented with this timepicker package.

The Input: Add "disableClick" as an input to prevent it opening the picker

<input [ngxTimepicker]="picker" [disableClick]="true">

You can't add type="time" to the input however because it doesn't accept the format the picker supplies/expects.

The element to open the picker

<ngx-material-timepicker-toggle [for]="picker"></ngx-material-timepicker-toggle>

The picker itself

<ngx-material-timepicker #picker></ngx-material-timepicker>

@Agranom
Copy link
Owner

Agranom commented Jan 27, 2019

@Aidan-Chey Sorry, I didn't get your reply

@rainbird17
Copy link

rainbird17 commented Feb 15, 2019

@Agranom - Has this feature been implemented yet? This is of interest to me as well, I would be happy to see this as a feature someday. There is another time picker I was looking at the other day called md-time-picker which has the ability to enter/modify the time via the inputs without entering the clock. I think your component is better overall, so we prefer to use yours, but you might want to look at that one as an example. The input fields are masked to prevent any invalid data/numbers from being entered and it supports 12h/24h mode editing.

@Agranom
Copy link
Owner

Agranom commented Feb 16, 2019

@rainbird17 Not yet. But this will be the next feature, right after resolving bug issues

@ndl7
Copy link

ndl7 commented Apr 9, 2019

Awesome work. Any update on the feature? Been waiting for half a year for this :) Thanks!

@Agranom
Copy link
Owner

Agranom commented Apr 10, 2019

Sorry guys, still cannot start implementing it. I hope this month I'll start

@Agranom
Copy link
Owner

Agranom commented Apr 11, 2019

Start thinking about how it should look like. It probably will be a component not a directive. But what about styling? Should it looks like a material input ?

@rainbird17
Copy link

We would prefer Material Design styling. Also make sure it supports 12/24 hour inputs, and restrict inputs to valid chars and such.

@Agranom
Copy link
Owner

Agranom commented May 13, 2019

Guys, sorry, still can't start implementing component (

@Agranom Agranom added the in progress started implementation label May 21, 2019
@Agranom
Copy link
Owner

Agranom commented May 22, 2019

Already started implementation. Do you need toggle button near time input to open timepicker ?

@jbthomps
Copy link
Author

For my use case, I would.

@Agranom
Copy link
Owner

Agranom commented Jun 8, 2019

Finally done it ). First version available on v3.2.0 (look at the demo page). If you'd like some improvements/fixes, please create an issue, because I'll close this one.

@Agranom Agranom closed this as completed Jun 8, 2019
@Agranom Agranom removed the in progress started implementation label Jun 8, 2019
@rajaramtt
Copy link

Without ngxTimepicker always getting am only, Putting hidden of ngxTimepicker worked for me.

Code Snippet

Template:

<input [ngxTimepicker]="picker" type="hidden" [formControl]="pickerInput" />
 <ngx-material-timepicker #picker (timeSet)="timeSetData($event)"></ngx-material-timepicker>

Comonet

 @ViewChild('picker') picker: NgxMaterialTimepickerComponent ;
   pickerInput = new FormControl('');
     -----------------
 
addTime():  void {
 this.pickerInput.setValue('12:00 am');
 this.picker.open();
 }

timeSetData(outputData) {
    --------------------
}

@MerySantos
Copy link

MerySantos commented Aug 12, 2019

@Agranom Hi, how use timeSet in this feature?

@Agranom
Copy link
Owner

Agranom commented Aug 15, 2019

Hi @MerySantos This feature is not available there

@Diksha2519
Copy link

I want to show a Invalid dateTime error into an mat-error.Can anybody help me out?

@Agranom
Copy link
Owner

Agranom commented Dec 18, 2019

@Diksha2519 I guess, it's better to validate timepicker input field within your component by rective forms

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

9 participants