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 support for font-awesome #49

Closed
mikehaertl opened this issue Oct 25, 2013 · 11 comments
Closed

Add support for font-awesome #49

mikehaertl opened this issue Oct 25, 2013 · 11 comments

Comments

@mikehaertl
Copy link

It would be cool, if we could configure our own icons. It already seems to work, if you use the form-group variant. But there's no way to configure the icon if you use the icon-less variant as in Example 6.

@Eonasdan
Copy link
Owner

The idea is to use this plugin with BS. However, I would think you could just overwrite the CSS classes for the calendar and clock icons

@mikehaertl
Copy link
Author

We use it with BS - but we use font awesome as icons, not glyphicons (which is probably a quite common scenario).

So a config option would be nice. The code doesn't need to change much for that.

@Eonasdan
Copy link
Owner

I haven't tried it myself, but this was in the original project
See line 72

You might just need to have a span with data-time-icon and data-date-icon. You should be able to give it the up/down icons too

@mikehaertl
Copy link
Author

Yeah, i've seen that - but this only works if you have enclosed the input in a div.control-group. All we'd need to do would be to change line 80 ff. to something like:

if (!picker.timeIcon) picker.timeIcon = picker.options.timeIcon;
...

And move the default values for timeIcon, upIcon and downIcon to defaults in line 33.

@Eonasdan
Copy link
Owner

maybe what would be better is to make picker.options.icon an object that holds all the icons

@mikehaertl
Copy link
Author

You mean like:

picker.options.icon = {
   time: 'glyphicon glyhpicon-time',
   up:  'glyphicon glyhpicon-chevron-up',
   ...

Looks good to me. dateIcon can be moved there, too.

Eonasdan added a commit that referenced this issue Oct 28, 2013
@Eonasdan
Copy link
Owner

@mikehaertl check out the latest commit. There's now support for an icon's array that you can provide some to all of the icons. Default to glyphicon

@kbtz
Copy link

kbtz commented Jun 11, 2015

You're welcome...

$.fn.datetimepicker.defaults.icons = {
    time: 'fa fa-clock-o',
    date: 'fa fa-calendar',
    up: 'fa fa-chevron-up',
    down: 'fa fa-chevron-down',
    previous: 'fa fa-chevron-left',
    next: 'fa fa-chevron-right',
    today: 'fa fa-dot-circle-o',
    clear: 'fa fa-trash',
    close: 'fa fa-times'
};

@zedtux
Copy link

zedtux commented Jan 22, 2016

Awesome @cvsguimaraes !

@dessalines
Copy link

That did it, thanks!

@pedrorio
Copy link

previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right'

Repository owner locked and limited conversation to collaborators Apr 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants