Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Calendar

  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calendar

    I have this code as and addon to a calendar
    Code:
    // ==UserScript==
    // @name           peflcalendar
    // @namespace      pefl
    // @description    calendar modification
    // @include        http://*pefl.*/plug.php?p=calendar&*
    // @version        1.0
    // ==/UserScript==
    
    $().ready(function() {
    	var time=new Date();
    	var currentDay = time.getDate();
    	var substring = '<B>' + currentDay + ' ';
    	$('td.back3').each(function(){
    		if ($(this).html().toUpperCase().indexOf(substring) == 0) {
    			$(this).css("border", "3px solid yellow");
    		}	
    	});
    });
    so what it does it puts a border on current day but when i go further in,like next month it also colors with yellow todays day. how do i fix this?

  • #2
    Regular Coder Apothem's Avatar
    Join Date
    Mar 2008
    Posts
    380
    Thanks
    36
    Thanked 25 Times in 25 Posts
    First this is JavaScript, not Java.

    Second, you would need to do use another each() call and set the border to its default color.

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Quote Originally Posted by Apothem View Post
    First this is JavaScript, not Java.

    Second, you would need to do use another each() call and set the border to its default color.
    Yes indeed, moving from Java to Javascript Frameworks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •