Jquery Date Picker with some dates in bold format

Go To StackoverFlow.com

4

how can we make a date shown in bold format?

var events = {};
events[new Date('02/14/2011')] = new Event('Valentines Day', 'mybold');
events[new Date('02/18/2011')] = new Event('Payday', 'mybold');
    $('#calender').datepicker({
        changeMonth : true,
        changeYear : true,
        beforeShowDay : function(date) {
            var event = events[date];
            if (event) {
                return [ true, 'mybold', event.text ];
            } else {
                return [ true, '', '' ];
            }
        }
    });
.
.
.
.
<style>
.mybold>a {
    font-weight:bold;
    background-color: yellow !important; 
    background-image: none !important;
}
</style>

It is showing the background colour as yellow but not showing the text in bold? Thanks

2012-04-04 08:02
by Ankur Verma
see the answers in http://stackoverflow.com/questions/4738293/can-you-bold-jquery-ui-datepicker-field - Haim Evgi 2012-04-04 08:05
I gone through it but that too is not working for m - Ankur Verma 2012-04-04 08:08


2

You should do

.mybold>a.ui-state-default {
    font-weight:bold;
    background-color: yellow;
    background-image: none;
}

fiddle here http://jsfiddle.net/3dHWh/2/

This works because targeting an element with a class is stronger than targeting an element generally, and for this reason you were not overriding the standard ui theme (so no need for !important at all)

2012-04-04 08:21
by Nicola Peluchetti
Thanks,great it worked for m - Ankur Verma 2012-04-04 10:15
Ads