Change the color of a specific day on the Arshaw Calendar using CSS

Can anyone help me with changing the color of the box in the month view in the arshaw calendar? I've been attempting to do so using this script, but my lack of expertise in javascript is proving to be a hurdle. The goal is for this script to be called with a specific day input to change its color. My approach involves saving today's date, navigating to the desired date on the calendar, trying to modify the CSS of the calendar (unsuccessfully), and finally resetting back to the original date. Unfortunately, all I see in the console when using Firebug is an "undefined" message.


function changeDate (dayToChange) {

var original=$('#calendar').fullCalendar( 'getDate' );

$('#calendar').fullCalendar('gotoDate',$('#calendar').fullCalendar.year,$('#calendar').fullCalendar.month, dayToChange );

$($('#calendar').fullCalendar( 'getDate' )).css('background-color', '#ffcccc');

$('#calendar').fullCalendar('gotoDate',original);
var e = $('#calendar').fullCalendar( 'getDate' );

}

Answer №1

This question has been asked numerous times before. Take a look at this example: change the color of a cell in a full calendar

We encourage you to conduct thorough research prior to submitting your inquiries here!

Answer №2

After some trial and error, I managed to solve it on my own :P

$('#calendar').find ('td.fc-day' + *dayToChange*).css('background-color', '#ffcccc');

This snippet can be implemented in any JavaScript code. The use of the find jQuery function is necessary here because its level is lower than ('#calender'), so it needs to search all levels. It's important to note that the day specified for change will alter the cell, not the actual calendar day.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Modify the text inside a div based on the navigation of another div

Hey there, experts! I must confess that I am an absolute beginner when it comes to JavaScript, JQuery, AJAX, and all the technical jargon. Despite my best efforts, I'm struggling to grasp the information I've found so far. What I really need is ...

What improvements can I implement to enhance the clarity and functionality of this form handler?

As a beginner working on my first Next.js app, I'm facing some challenges that seem more React-related. My app allows users to add and edit stored food items and recipes, requiring me to use multiple submit form handlers. Each handler involves: Che ...

What is the Best Way to Send JavaScript Variables to MYSQL Database with PHP?

I am having trouble sending my variable to a MySQL database. The database only displays the variable when using the HTML input tag. The error message I received was "Undefined index: rate & amount." Seeking assistance to resolve this issue. Thank you! ...

Comparison of utilizing PHP within CSS versus Implementation through JavaScript [General]

Curious about the incorporation of PHP in CSS, especially in relation to my current Wordpress Theme project. I am aiming for high levels of customization and have been using a JS file to change CSS Properties through PHP. However, I'm not entirely con ...

How to conceal certain sections of HTML using jQuery

Currently, I am in the process of creating a "news" page for a website. My goal is to only show the first 15 lines of each news article when the page is loaded, creating a neat appearance for visitors. After the 15th line, I include a "read more" link tha ...

What are the best methods for ensuring JSON compatibility with Internet Explorer versions 7 and 8?

After implementing jQuery on my website, I encountered issues with Internet Explorer. Despite numerous attempts to fix it, I discovered that the problem lies with JSON not functioning properly in IE. I tried inserting the following code snippet, but it sti ...

The function HandleKeyPress is failing to recognize the input from the down arrow

I'm currently working on developing a customized and user-friendly select input using React.js. My goal is to have the functionality where the up and down arrow keys behave like the tab key within the context of selecting options. In order to achieve ...

An unusual problem encountered with JSON and PHP

Is there a specific reason why a JSON string fails to be evaluated (transport.responseText.evalJSON();) on the server but works fine on my local setup? I'm making a simple AJAX request like this: new Ajax.Request( this.saveUrl, { ...

What is the best way to activate a component within Angular 2 that triggers the display of another component through method invocation?

I have created a popup component that can be shown and hidden by calling specific methods that manipulate the back and front variables associated with the class. hide() { this.back = this.back.replace(/[ ]?shown/, ""); this.front = this.front.replace( ...

Combining various FormGroup types into a single object type in Angular 5

I am currently utilizing the mat-stepper feature from the Angular Material design library. Within my application, I am using 3 separate FormGroups to gather information and send it to a database using the httpClient method. To achieve this, I have defined ...

When incorporating conditional statements into your code, make sure to utilize the tags <script> along with

I have some script tags as shown below: <script src="cordova-2.5.0.js"></script> <script src="js/jquery-1.7.2.min.js"></script> <script src="js/jquery.mobile-1.1.1.min.js"></script> <script src="js/jquery.xdomainajax ...

What is the best way to handle a large number of nested AJAX GET requests?

My task involves making numerous AJAX GET requests, which must be nested because each request depends on variables from the response of the previous one. Although I was able to make multiple requests with the example below, it becomes impractical when dea ...

When the beforeSend function of jQuery AJAX returns false, it triggers the $.ajaxError event

function load() { var url = buildUrl(null, true); $.ajax(url, { cache: true, dataType: 'json', beforeSend: function(xhr) { if (typeof plugin.cache[url] != ...

Utilize React Material UI to elegantly envelop your TableRows

Currently, I am faced with a challenge involving a table that utilizes Material UI and React-table. My goal is to wrap text within the TableRow element, but all my attempts have not been successful so far. Is there anyone who knows the best approach to a ...

Is there a way to eliminate currency within an Angularjs directive?

Currently, I am utilizing a directive to properly display currency format. You can find the directive at this URL: http://jsfiddle.net/ExpertSystem/xKrYp/ Is there a way to remove the dollar symbol from the output value and only retain the converted amoun ...

I'm looking to have a span and an input side by side, both spanning the full width of the containing div. How can I achieve this?

In my code snippet below: <html> <body> <div style="width: 700px;"> <span>test</span> <input style="width: 100%;"></input> </div> </body> </html> I am facing an issue where the span and input el ...

Troubleshooting: Fixed Header Issue in HTML5 Responsive Web Design

My goal is to develop a simple HTML5 responsive web layout with a fixed header. I am striving to maintain clean HTML and CSS code while adhering to best practices. The header is designed to have a maximum width of 980 pixels, with a blue background that ex ...

Tips for Designing a Custom Footer Layout for KoGrid

Is it possible to create a footer template for a koGrid that displays the sum of a column? gridOptions : { displaySelectionCheckbox: false, data: items, // selectedItems: self.selectedItems, multiSelect: false, ena ...

Ensuring Proper Alignment of Headers in CSS

I'm struggling to align my header correctly. Despite getting close in Internet Explorer, it looks terrible in Firefox with the code below. I've scoured forums for solutions but the more I try to fix it, the worse it looks. All I want is for heade ...

Tips for saving the ajax response to the browser cache using jquery

I am currently working on storing the ajax response in the browser cache. I have successfully managed to store it for URLs like (example.com), but now I am facing a challenge with storing data for URLs like (example.com?xyz=abc%20efg&mno=hjk). Here is ...