Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Enable only Mondays. JIRA Date Picker

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2015

Can we enable only Mondays on JIRA Date Picker?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2015

.calendar tr td.day:nth-child(-n+6){

background: #D8D8D8 

pointer-events: none 

cursor: default ;

}

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2015

You can do it with less text: .calendar tr td.day:nth-child(-n+7){ background: grey; pointer-events: none; cursor: default; } Please see here for nth-child explanation: https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 12, 2015

Yes. It is perfectly working !! Thanks for the tip.

0 votes
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 10, 2015

How did you choose to inject the JavaScript?

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 12, 2015

My datepicker was for a custom plugin. I am using a custom JS and CSS file to write the script.

0 votes
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2015

You can do it via css.

For AUI date picker:

.aui-datepicker-dialog tr td:nth-child(n+2){
 background: yellow;
 pointer-events: none;
 cursor: default;
}

And here is a fiddle: http://jsfiddle.net/pnr39swu/

and similar approach for JIRA date picker when Sunday is configured as first day:

.calendar tr td.day:nth-child(2){
 background: grey;
 pointer-events: none;
 cursor: default;
}
.calendar tr td.day:nth-child(n+4){
 background: grey;
 pointer-events: none;
 cursor: default;
}

Fiddle: http://jsfiddle.net/Lk4ggwdq/

When Monday is the first week day:

.calendar tr td.day:nth-child(n+3){
 background: grey;
 pointer-events: none;
 cursor: default;
}

 

If you need to disable days from code, jquery has similar selector method: https://api.jquery.com/nth-child-selector/

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2015

The above css is not calling. here is the snippet from vm file. <div class="project-config-date-field" id="week-dev"> <input id="week-input" name=week-input type="text" class="text medium-field" value="" title="Select a date" /> <a href="#" id="week-trigger" title="Select a date"> <span class="aui-icon icon-date">Select a date</span></a> </div>

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2015

Sorry, posted wrong fiddle. Correct one: http://jsfiddle.net/pnr39swu/ It works fine.

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2015

Hi Volodymyr, Sorry I mentioned as AUI date picker. My bad.. I am actually working on JIRA Date picker component.

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2015

Hi Volodymyr, Is there any workaround for disabling days on JIRA Date Picker?

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2015

Hi srinivas! Please see the update answer.

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2015

Hi Volodymyr, Is there any workaround for disabling days on JIRA Date Picker? Hi Volodymyr, Is there any workaround for disabling days on JIRA Date Picker? Hi Volodymyr, Thank you for the comment.. It is working. Could you please tell me how to enable only Saturdays(Sunday is first day of calendar)?

srinivasp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2015

One more question: We have a disable function on the calendar to disable future dates and it was working. When we click the '>'(Next Month), the future date is capturing on text box though the calendar was found disabled. Appreciate if you could also tell us how to enable only Saturdays(Sunday is first day) disableFunc : function(date) { var today = new Date(); if (date >= today) { return true; } }

ramesh gangani July 2, 2015

Hi Volodymyr, Can you please let me know how can I enable saturday of current week?

TAGS
AUG Leaders

Atlassian Community Events