Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #23614 > unrolled thread
| Started by | Luis Vicente <luisvicent91@gmail.com> |
|---|---|
| First post | 2014-03-21 08:42 -0700 |
| Last post | 2014-03-31 10:40 +0200 |
| Articles | 6 — 3 participants |
Back to article view | Back to comp.lang.javascript
help with plugin Full calendar Luis Vicente <luisvicent91@gmail.com> - 2014-03-21 08:42 -0700
Re: help with plugin Full calendar "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-21 17:22 +0100
Re: help with plugin Full calendar Luis Vicente <luisvicent91@gmail.com> - 2014-03-21 09:49 -0700
Re: help with plugin Full calendar "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-21 18:01 +0100
Re: help with plugin Full calendar Gloops <gloops@zailes.invalid.org> - 2014-03-31 10:04 +0200
Re: help with plugin Full calendar "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-31 10:40 +0200
| From | Luis Vicente <luisvicent91@gmail.com> |
|---|---|
| Date | 2014-03-21 08:42 -0700 |
| Subject | help with plugin Full calendar |
| Message-ID | <0dc7e8a9-dbe7-4d3d-a92a-236e44544419@googlegroups.com> |
Hi!. I am using the plugin Full Calendar and I have this trouble:
I need to change the color, for example, of the day 1 in march(only this day). But when I change the color, april 01 also changes. I do not how to manage that.
This my function to change the color of only march 01:
dayRender: function (date, cell) {
var today = new Date();
var end = new Date();
end.setDate(1,3,14);
if (date.getDate() === end.getDate()) {
cell.css("background-color", "red");
}
[toc] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-03-21 17:22 +0100 |
| Message-ID | <XnsA2F7B0AEDF684eejj99@194.109.133.133> |
| In reply to | #23614 |
Luis Vicente <luisvicent91@gmail.com> wrote on 21 mrt 2014 in comp.lang.javascript: > Hi!. I am using the plugin Full Calendar and I have this trouble: And what might that be "the plugin Full Calendar"? We here discuss Javascript, we are not experts on some plugin, and we don't "do" libraries, that have their own fora. > end.setDate(1,3,14); setDate() sets the day-of-the-month and uses only one parameter. Your second and third parameter are simply ignored [Chrome tested]. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Luis Vicente <luisvicent91@gmail.com> |
|---|---|
| Date | 2014-03-21 09:49 -0700 |
| Message-ID | <24b3db16-4847-4d3f-b308-8f3becc36483@googlegroups.com> |
| In reply to | #23615 |
I am really sorry. I only wanted someone help me! and thank very much. You are alright. The parameters never be found!
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-03-21 18:01 +0100 |
| Message-ID | <XnsA2F7B765163E9eejj99@194.109.133.133> |
| In reply to | #23616 |
Luis Vicente <luisvicent91@gmail.com> wrote on 21 mrt 2014 in comp.lang.javascript: > I am really sorry. I only wanted someone help me! Please adhere to the netiquette of usenet, this is NOT email. So always quote what you are responding on. > and thank very much. You are alright. The parameters never be found! That, were DEBUGGING is for. You should test if the state of a variable alters after a statement in accordance with what you want it to do. var d = new Date(); alert(d); d.setDate(1,12,456456456,2,2,2); alert(d); d.setDate(-12,8,8,8,8,8); alert(d); -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gloops <gloops@zailes.invalid.org> |
|---|---|
| Date | 2014-03-31 10:04 +0200 |
| Message-ID | <lhb7is$2sb$1@usenet.pasdenom.info> |
| In reply to | #23614 |
Luis Vicente wrote, on 21st March 2014 16:42 UTC + 2 :
> Hi!. I am using the plugin Full Calendar and I have this trouble:
>
> I need to change the color, for example, of the day 1 in march(only this day). But when I change the color, april 01 also changes. I do not how to manage that.
>
>
> This my function to change the color of only march 01:
>
> dayRender: function (date, cell) {
> var today = new Date();
> var end = new Date();
> end.setDate(1,3,14);
>
> if (date.getDate() === end.getDate()) {
> cell.css("background-color", "red");
> }
>
Hello,
Without knowing all the ins and outs, I see you change the format of the
cell when it is set to a certain date, but you do not set it back when
the date is different.
It could look like something like this :
if (date.getDate() === end.getDate()) {
cell.css("background-color", "red");
}
else
{
cell.css("background-color", "white");
}
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-03-31 10:40 +0200 |
| Message-ID | <XnsA3016C838CFFAeejj99@194.109.133.133> |
| In reply to | #23752 |
Gloops <gloops@zailes.invalid.org> wrote on 31 mrt 2014 in
comp.lang.javascript:
> Luis Vicente wrote, on 21st March 2014 16:42 UTC + 2 :
>> Hi!. I am using the plugin Full Calendar and I have this trouble:
>>
>> I need to change the color, for example, of the day 1 in march(only
>> this day). But when I change the color, april 01 also changes. I do not
>> how to manage that.
>>
>>
>> This my function to change the color of only march 01:
>>
>> dayRender: function (date, cell) {
>> var today = new Date();
>> var end = new Date();
>> end.setDate(1,3,14);
>>
>> if (date.getDate() === end.getDate()) {
>> cell.css("background-color", "red");
>> }
>>
>
>
> Hello,
>
> Without knowing all the ins and outs, I see you change the format of the
> cell when it is set to a certain date, but you do not set it back when
> the date is different.
>
> It could look like something like this :
>
> if (date.getDate() === end.getDate()) {
> cell.css("background-color", "red");
> }
> else
> {
> cell.css("background-color", "white");
> }
>
No that does not help and is not necessary.
getDate(),
contrary to your assumption,
only fetches the monthly day-number,
independent of the month and the year.
<http://www.w3schools.com/jsref/jsref_getdate.asp>
Try:
=== css ===
td {background-color:white;}
=== js ===
var cellDate = new Date(thisCell.innerHTML);
var isTrue = (cellDate.getDate() == 1) &&
(cellDate.getMonth() == 3-1);
if (isTrue) thisCell.style.backgroundColor = 'red';
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web