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

Add select and input[type='number'] as choices for time inputs #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

strux
Copy link

@strux strux commented Apr 9, 2013

I added some new inputs/features for a project I'm working on and thought you may be interested in merging them.

This branch adds several new options to the input:
:time_input => :text (default), :select or :number

The following apply to input types: :select and :number
:minute_step => integer
:hours_24 => true or false (default)

Examples:

m.input :born_at, 
  as: :just_datetime_picker, time_input: :select, minute_step: 15
# Would render minute as select with four options: 00, 15, 30, 45

m.input :born_at, 
  as: :just_datetime_picker, time_input: :number, hours_24: true
# Would render hour as <input type='number'... with 24 options: 00..23

@mspanc
Copy link
Owner

mspanc commented Apr 10, 2013

Hi Ben, thank you for your contribution.

I will definitely merge such functionality into this gem, but with some modifications:

  • 24h mode has to be default as otherwise it will break default behavior of current and past versions,
  • AM/PM indicator should be taken from locales (e.g. Greeks use π.µ. and µ.µ., respectively).

So if you plan to rely on this gem in your project when I will release merged version, please take this into account.

@strux
Copy link
Author

strux commented Apr 10, 2013

Hi saepia,

I went ahead and made those changes as they were both good points. Feel free to use or not...

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

Successfully merging this pull request may close these issues.

2 participants