build_options(selected, options = {}) private

Build select option HTML from date value and options.

build_options(15, start: 1, end: 31)
=> "<option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>..."

If use_two_digit_numbers: true option is passed:

build_options(15, start: 1, end: 31, use_two_digit_numbers: true)
=> "<option value="1">01</option>
    <option value="2">02</option>
    <option value="3">03</option>..."

If :step options is passed:

build_options(15, start: 1, end: 31, step: 2)
=> "<option value="1">1</option>
    <option value="3">3</option>
    <option value="5">5</option>..."
Show source
Register or log in to add new notes.