ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Is it possible to specify 12 hour format?

Open Toktik opened this issue 6 years ago • 9 comments

I would like to be able to have a mask with 12 hour format like HH:MM (AM/PM). Ideally, on keypressing to up or down the AM/PM should change.

Is this possible with ngx-mask?

Toktik avatar Oct 24 '19 11:10 Toktik

Hi @isysenko Thanks for adding this issue to the To-Do list. Any ideas when it will be implemented?

jacob-l avatar Jan 09 '20 09:01 jacob-l

Even I am also waiting for this feature. Any updates when this will be released?

paras-deshbhratar avatar Aug 13 '20 05:08 paras-deshbhratar

It's been a full year. Still no update. I am looking for a solution as well.

wcooperscott avatar Nov 17 '20 21:11 wcooperscott

any update ?

mbabaei0 avatar Aug 17 '21 08:08 mbabaei0

@isysenko I implemented this feature, but I don't have access rights to push my changes. Can you give them to me so I can prepare a pull request?

fiiiiif avatar Apr 22 '22 22:04 fiiiiif

Any updates on this feature?

daniel-barac avatar May 05 '22 10:05 daniel-barac

I'm looking for this feature two, can someone give @fiiiiif the access for PR?

bianca-patientnow avatar Jun 02 '22 18:06 bianca-patientnow

@isysenko I implemented this feature, but I don't have access rights to push my changes. Can you give them to me so I can prepare a pull request?

can you please share your way to do that or make another repo and share for help. Thanks in advance

preetamjakhmola avatar Jun 26 '22 16:06 preetamjakhmola

we really need this feature!

Androsid avatar Aug 02 '22 06:08 Androsid

@Androsid @preetamjakhmola @bianca-patientnow @jacob-l @Toktik @daniel-barac @paras-deshbhratar @jacob-l Thanks for your using Ngx-Mask. Please update to latest version. It example, we add [apm] for 12 hour format -https://stackblitz.com/edit/angular-dzyuwe?file=src%2Fmain.ts

andriikamaldinov1 avatar Aug 03 '23 14:08 andriikamaldinov1

Hi, thx for this feature! But there is a small problem. I can't input 12:01. But instead it allows me to input 00:01. https://en.wikipedia.org/wiki/12-hour_clock

egorkel-altexsoft avatar Aug 18 '23 09:08 egorkel-altexsoft

@egorkel-altexsoft Thanks for using Ngx-Mask. Please update to latest version. All work as expected - https://stackblitz.com/edit/angular-hfrynj?file=src%2Fmain.ts

andriikamaldinov1 avatar Aug 30 '23 13:08 andriikamaldinov1

Nice! It allows me to enter 12 hours now, but still, it allows me to enter 0 hours, which is not correct for 12-h notation.

image

Or I'm wrong?

egorkel-altexsoft avatar Aug 30 '23 14:08 egorkel-altexsoft

@egorkel-altexsoft what do you expect to see when a user enters 00 ???

andriikamaldinov1 avatar Aug 30 '23 14:08 andriikamaldinov1

Same behavior as for number input when you are not allowed to enter letters. You just can't enter 00.

egorkel-altexsoft avatar Aug 30 '23 15:08 egorkel-altexsoft

Well, if we talk about a 12-hour format then instead of 00:00 user should use 12:00. Or at least there should be an option for a "strict" format. Or if you think you are good with this feature, can you tell me how I can use such kind of regexp /^(?:1[012]|0[1-9]):[0-5][0-9]$/ with your library?

egorkel-altexsoft avatar Aug 30 '23 16:08 egorkel-altexsoft

@egorkel-altexsoft We disabled to enter 00. It example - https://stackblitz.com/edit/angular-lukujr?file=src%2Fmain.ts

andriikamaldinov1 avatar Sep 05 '23 11:09 andriikamaldinov1

Awesome! Thank you @andriikamaldinov1 👍

egorkel-altexsoft avatar Sep 05 '23 11:09 egorkel-altexsoft

@egorkel-altexsoft We disabled to enter 00. It example - https://stackblitz.com/edit/angular-lukujr?file=src%2Fmain.ts

@andriikamaldinov1 how to distinguish between AM/PM?

tiago-eusebio-dev avatar Sep 19 '23 19:09 tiago-eusebio-dev

I'm using additional button to switch between am/pm

egorkel-altexsoft avatar Sep 19 '23 20:09 egorkel-altexsoft