I have SharePoint calendar and I want the entries to be in color based on status. If user add one entry and status is initially pending then that task would be in green, later it get changed to in progress then task color should change to yellow and blue for resolved.

in progress=yellow

How can I achieve this, can anyone provide me javascript code for same

3 Answers 3


Instead of using JavaScript to color code which you can find code for doing here I'd recommend that you use the standard Overlay capabilities of SharePoint calendars.

  1. Create three additional views Pending, Progress and Resolved which only show items in the appropriate status.
  2. Change the default view to only show Status = "None".
  3. In the "Calendar Tools|Calendar" ribbon tab click "Calendars Overlay"
  4. For each of the three stati
    1. Click New Calendar
    2. Fill in information like this
      1. Calendar Name: Pending
      2. Type: SharePoint
      3. Color: Light Green
      4. Web URL: Leave alone
      5. Click Resolve
      6. Select right Calendar as List
      7. Select right View as List View
      8. Always Show: Checked

enter image description here


This you can do by Out of the the Box SharePoint. You will not need JavaScript just try to follow below link, which will help you step by step




The below article was helpful in achieving this functionality using JavaScript:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.