• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kollavarsham / calendar / 4109610947

pending completion
4109610947

push

github

Floyd Pink
feat: add 'selected day' on-click functionality

66 of 66 branches covered (100.0%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 1 file covered. (100.0%)

199 of 211 relevant lines covered (94.31%)

366.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/app/scripts/directives/calendar-day.js
1
'use strict';
2

3
/**
4
 * @ngdoc directive
5
 * @name calendarApp.directive:calendarDay
6
 * @description
7
 * # calendarDay
8
 */
9
angular.module('calendarApp')
1✔
10
  .directive('calendarDay', function (utils, $state) {
11
    return {
99✔
12
      restrict    : 'E',
13
      templateUrl : 'views/calendar-day.html',
14
      scope       : {
15
        day : '=day',
16
        lang: '=lang'
17
      },
18
      link        : function (scope, element) {
19
        var day = scope.day;
3,460✔
20
        if (!day.date) {
3,460✔
21
          return;
583✔
22
        }
23
        // add a fullDate property to show the full date
24
        day.fullDate = day.date + ' ' + day.month + ' ' + day.year;
2,877✔
25

26
        // add amavasi and purnima (newmoon and fullmoon) into the calendar
27
        var NEW_MOON_UNICODE = '🌑';
2,877✔
28
        var FULL_MOON_UNICODE = '🌕';
2,877✔
29
        day.moon = day.tithi === 0 ? FULL_MOON_UNICODE : day.tithi === 15 ? NEW_MOON_UNICODE : undefined;
2,877✔
30
        day.tithiDay = day.moon || utils.tithisLookup[day.tithi][scope.lang || 'ml'];
2,877✔
31

32
        element.on('click', function () {
2,877✔
33
          var date = new Date(day.fullDate);
×
34
          date.setHours(12);
×
35
          $state.go($state.current.name, {year : date.getFullYear(), month : date.getMonth() + 1, sel: date.toISOString()});
×
36
        });
37
      }
38
    };
39
  });
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc