mattlewis92 / angular-bootstrap-calendar

A port of the bootstrap calendar widget to AngularJS (no jQuery required!)
https://mattlewis92.github.io/angular-bootstrap-calendar/
MIT License
798 stars 369 forks source link

Title of the calendar #580

Closed marcoos13 closed 7 years ago

marcoos13 commented 7 years ago

Hey, there awesome work!

I have a question about the title of the calendar in week display for example: See the attach image. image Is there a way to change the format into a different one like: 2017 Apr, 9-15 Instead of: Week 16 of 2017

Thank you, Cheers:)

codecov-io commented 7 years ago

Codecov Report

Merging #580 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #580   +/-   ##
=======================================
  Coverage   95.83%   95.83%           
=======================================
  Files          26       26           
  Lines         697      697           
=======================================
  Hits          668      668           
  Misses         29       29

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f7ec47f...1d608e0. Read the comment docs.

mattlewis92 commented 7 years ago

You need to override the calendarTitle.week function like so:

angular
  .module('myApp', [])
  .run(function(calendarConfig) {
    calendarConfig.week = function(viewDate) {
      // Use moment to format the date as you require: https://momentjs.com/docs/#/displaying/
    };
  })

Hope that helps! 😄

marcoos13 commented 7 years ago

Hey mattlewis92, Thank you for your quick response!

I tried what you mentioned here, but for some reason, It never reaches the function: image

mattlewis92 commented 7 years ago

Sorry wrong service, it should be calendarTitle not calendarConfig

marcoos13 commented 7 years ago

Thank you very much, I really appreciate that :)