Thread: DatePicker CSS

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    113
    Rep Power
    16

    DatePicker CSS


    Hey,

    I've got a date picker on a page and i need to style the background color of the days of the month. CSS from another jquery element is interfering with this so i figured i could use the beforeshow or the beforeshowday options but I'm unsure how to use these to accomplish these results.

    I need to style greyed out days, qeekends and week days.

    Side note: I was able to style the weekends by adding this but can't figure out how to style the week days and the greyed out days.
    Code:
    <STYLE>
    .ui-datepicker-week-end a {background: grey !important;}
    </STYLE>
    Thanks for any help.

    DSFX.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    17
    Rep Power
    0
    Do you want to do something like this where it grey on the weekends and colored on the weekdays? Heres the code:

    <script>
    window.onload=function()
    {
    var d = new Date();
    var n = d.getDay();
    //n=day
    //if (n==0)sunday(); if (n==1)monday(); if (n==0)tuesday()...
    if(n==6 || n==0){
    document.body.style.background="#f3f3f3";
    }else{
    document.body.style.background="blue";
    }
    }
    </script>
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    113
    Rep Power
    16
    Thank you, it's the simplest thing but for whatever reason i couldn't wrap my head around it. A good night's sleep fixed this.

    DSFX
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    17
    Rep Power
    0
    Maybe you were just didn't have enough caffeine or something.

IMN logo majestic logo threadwatch logo seochat tools logo