ember-cli-bootstrap-datepicker icon indicating copy to clipboard operation
ember-cli-bootstrap-datepicker copied to clipboard

Support for component mode?

Open timolehto opened this issue 10 years ago • 5 comments
trafficstars

Hey, looks solid stuff. Good job. However what I'm missing is a way to set the picker to component mode. Is that possible? http://bootstrap-datepicker.readthedocs.org/en/release/markup.html#component

What i'd like to have is a calendar icon and possibly some other added markup and classes. Can this be achieved with this component?

Sample datepicker markup I'd love to make this component produce:

<div class="form-group">
  <label for="dueDate" class="col-sm-4 control-label">
    Alkaen
  </label>
  <div class="col-sm-8 datetimepicker input-group date">
    <input id="dueDate" class="ember-view ember-text-field form-control" placeholder="Click to play" type="text">
    <span class="input-group-addon">
      <span class="glyphicon-calendar glyphicon"></span>
    </span>
  </div>
</div>

timolehto avatar Feb 21 '15 10:02 timolehto

I mean I can see there's nothing stopping me from doing this (which is why ended up doing it):

<div class="form-group">
  <label for="startDate" class="col-sm-4 control-label">
    {{t 'archives.starting'}}
  </label>
  <div class="col-sm-8 datetimepicker input-group date">
    {{bootstrap-datepicker
            value=startDate
            autoclose=true
            calendarWeeks=true
            clearBtn=true
            language='fi'
            id=dueDate
            class='form-control'}}
    <span class="input-group-addon">
      <span class="glyphicon-calendar glyphicon"></span>
    </span>
  </div>

But then the calendar glyph is nonfunctioning and afaik bare bs datepicker makes clicking the glyph also open the calendar. If I want this behaviour, I need to come up with my own glue JS to make it happen? I found a way to make this happen by wrapping this all on a component of my own and making clicks on the glyph move focus on the input field, so not an urgent thing, but have you thought about building support for this into the component its self?

timolehto avatar Feb 21 '15 18:02 timolehto

Hey @timolehto! Thanks for the idea. At the moment date-range and component modes are not supported, but you are right it would be awesome to cover all available modes of bootstrap-datepicker.

Actually I did the same trick you did to "simulate" component mode :smile: So I would implement support for date-range and component modes soon.

soulim avatar Feb 21 '15 18:02 soulim

Can we expect this feature in the near future? It would be awesome.

BenjaminHorn avatar Apr 04 '15 22:04 BenjaminHorn

Yep, support for all available features of bootstrap-datepicker is on my list.

soulim avatar Apr 05 '15 07:04 soulim

Hello @soulim, thanks for the awesome add-on. :) Just wanted to know if there is an update on this issue.

monsteronfire avatar Aug 10 '16 06:08 monsteronfire