All Projects → twinssbc → Angularjs Responsivecalendar

twinssbc / Angularjs Responsivecalendar

Licence: mit
A pure AngularJS responsive calendar directive

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Angularjs Responsivecalendar

Swift Week View
An iOS calendar library for displaying calendar events in a week view.
Stars: ✭ 88 (-22.81%)
Mutual labels:  calendar
Pylunarcalendar
简介:无需数据库,以《钦定协纪辨方书》为核心的python3 农历、黄历、二十四节气、节假日、星次、每日凶煞、每日值神、建除十二神、每日宜忌、彭祖百忌、每日五行、二十八星宿、天干地支、生辰八字、时辰凶吉等开源项目。背景: 由于三体运动(主要地球、太阳、月球)无法准确预测,目前二十四节气依然还是靠天文台观测,Yovey使用传说中[Y*D+C]-L 寿星通用公式 方法实际有很多天数不准,def getSolarTerms(_date)12个if嵌套判断让代码变得十分冗余,由简书网友“大咖_247c”首先发现计算不准问题……
Stars: ✭ 106 (-7.02%)
Mutual labels:  calendar
Nativescript Ui Feedback
This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Stars: ✭ 110 (-3.51%)
Mutual labels:  calendar
React Native General Calendars
React Native Calendar Components 📆
Stars: ✭ 94 (-17.54%)
Mutual labels:  calendar
Qbox
🐈 RxJava+Retrofit+Okhttp+Glide + A life tool App, contains modules: news; jokes; constellation fortune; LED; weather; calendar; two-dimensional code, and more ... 小秋魔盒是一个生活工具 App,主要功能有:新闻资讯;微信精选美文;笑话趣图;星座运势;LED字幕;天气;日历;二维码;手电筒;老黄历。在开发中尽可能多的用了目前比较流行的框架和库。
Stars: ✭ 1,360 (+1092.98%)
Mutual labels:  calendar
Fscalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift
Stars: ✭ 9,829 (+8521.93%)
Mutual labels:  calendar
Persiandatepicker
An Android DatePicker for Persian Calendar
Stars: ✭ 86 (-24.56%)
Mutual labels:  calendar
Calendarhtml Javascript
Simple Calendar built with Pure JavaScript (No Libraries) http://iamnitinpatel.com/projects/calendar/
Stars: ✭ 113 (-0.88%)
Mutual labels:  calendar
Ummalqura Calendar
Implementation of java.util.Calendar for the Umm Al-Qura calendar system.
Stars: ✭ 104 (-8.77%)
Mutual labels:  calendar
Calendarx
📅 Your go-to, prescribed, Calendar component for React
Stars: ✭ 110 (-3.51%)
Mutual labels:  calendar
Quick Plan
Defines and schedules Garmin workouts
Stars: ✭ 93 (-18.42%)
Mutual labels:  calendar
Simple React Calendar
A simple react based calendar component to be used for selecting dates and date ranges
Stars: ✭ 97 (-14.91%)
Mutual labels:  calendar
Pg Calendar
📆 beautiful and eidetic date picker
Stars: ✭ 109 (-4.39%)
Mutual labels:  calendar
Calendar views
Collection of customisable calendar related widgets for Flutter.
Stars: ✭ 92 (-19.3%)
Mutual labels:  calendar
Calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
Stars: ✭ 113 (-0.88%)
Mutual labels:  calendar
Android Calendarview Master
Android开发实现自定义日历、日期选择控件
Stars: ✭ 87 (-23.68%)
Mutual labels:  calendar
Timex
A complete date/time library for Elixir projects.
Stars: ✭ 1,538 (+1249.12%)
Mutual labels:  calendar
Csdwheels
一套基于原生JavaScript开发的插件,无依赖、体积小
Stars: ✭ 114 (+0%)
Mutual labels:  calendar
Calendarheatmap
A calendar based heatmap which presenting a time series of data points in colors.
Stars: ✭ 113 (-0.88%)
Mutual labels:  calendar
Vue Schedule Calendar
日程调度日历。
Stars: ✭ 110 (-3.51%)
Mutual labels:  calendar

ui-rCalendar directive

A pure AngularJS responsive calendar directive

You could also check https://github.com/twinssbc/Angular-Customizable-Calendar for the Angular version.
If you want to only use it in Ionic framework, please check https://github.com/twinssbc/Ionic2-Calendar for the Ionic specific version

Demo

http://twinssbc.github.io/AngularJS-ResponsiveCalendar/demo/

Usage

Bower Install: bower install ng-responsive-calendar

Load the necessary dependent files:

<link rel="stylesheet" href="../lib/bootstrap/dist/css/bootstrap.css"/>
<link rel="stylesheet" href="<bower lib installation path>/ng-responsive-calendar/dist/css/calendar.min.css"/>
<script src="../lib/angular/angular.js"></script>
<script src="<bower lib installation path>/ng-responsive-calendar/dist/js/calendar-tpls.min.js"></script>

Add the calendar module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['ui.rCalendar'])

Add the directive in the html page

<calendar calendar-mode="mode" event-source="eventSource">

Options

  • formatDay
    The format of the date displayed in the month view.
    Default value: 'dd'

  • formatDayHeader
    The format of the header displayed in the month view.
    Default value: 'EEE'

  • formatDayTitle
    The format of the title displayed in the month view.
    Default value: 'MMMM dd, yyyy'

  • formatWeekTitle
    The format of the title displayed in the week view.
    Default value: 'MMMM yyyy, Week w'

  • formatMonthTitle
    The format of the title displayed in the month view.
    Default value: 'MMMM yyyy'

  • formatWeekViewHeader
    The format of the header displayed in the week view.
    Default value: 'EEE d'

  • formatHourColumn
    The format of the hour column displayed in the week and day view.
    Default value: 'ha'

  • calendarMode
    The initial mode of the calendar.
    Default value: 'month'

  • showWeeks
    If set to true, a week number column will be displayed in the month view.
    Default value: false

  • showEventDetail
    If set to true, when selecting the date in the month view, the events happened on that day will be shown below.
    Default value: true

  • startingDay
    Control month view starting from which day.
    Default value: 0

  • allDayLabel
    The text displayed in the allDay column header.
    Default value: 'all day'

  • noEventsLabel
    The text displayed when there’s no event on the selected date in month view.
    Default value: 'No Events'

  • eventSource
    The data source of the calendar, when the eventSource is set, the view will be updated accordingly.
    Default value: null
    The format of the eventSource is described in the EventSource section

  • queryMode
    If queryMode is set to 'local', when the range or mode is changed, the calendar will use the already bound eventSource to update the view
    If queryMode is set to 'remote', when the range or mode is changed, the calendar will trigger a callback function rangeChanged.
    Users will need to implement their custom loading data logic in this function, and fill it into the eventSource. The eventSource is watched, so the view will be updated once the eventSource is changed.
    Default value: 'local'

  • step
    It can be set to 15 or 30, so that the event can be displayed at more accurate position in weekview or dayview.

  • rangeChanged
    The callback function triggered when the range or mode is changed if the queryMode is set to 'remote'

      $scope.rangeChanged = function (startTime, endTime) {
          Events.query({startTime: startTime, endTime: endTime}, function(events){
              $scope.eventSource=events;
          });
      };
    
  • eventSelected
    The callback function triggered when an event is clicked

      <calendar ... event-selected="onEventSelected(event)"></calendar>
    
    
      $scope.onEventSelected = function (event) {
          console.log(event.title);
      };
    
  • timeSelected
    The callback function triggered when a date or time is selected

      <calendar ... time-selected="onTimeSelected(selectedTime, events)"></calendar>
      
      $scope.onTimeSelected = function (selectedTime, events) {
      	console.log('Selected time: ' + selectedTime + ' hasEvents: ' + (events !== undefined && events.length !== 0));
      };
    

EventSource

EventSource is an array of event object which contains at least below fields:

  • title

  • startTime
    If allDay is set to true, the startTime has to be as a UTC date which time is set to 0:00 AM, because in an allDay event, only the date is considered, the exact time or timezone doesn't matter.
    For example, if an allDay event starting from 2014-05-09, then startTime is

      var startTime = new Date(Date.UTC(2014, 4, 8));
    
  • endTime
    If allDay is set to true, the startTime has to be as a UTC date which time is set to 0:00 AM, because in an allDay event, only the date is considered, the exact time or timezone doesn't matter.
    For example, if an allDay event ending to 2014-05-10, then endTime is

      var endTime = new Date(Date.UTC(2014, 4, 9));
    
  • allDay
    Indicates the event is allDay event or regular event

Note In the current version, the calendar controller only watches for the eventSource reference as it's the least expensive. That means only you manually reassign the eventSource value, the controller get notified, and this is usually fit to the scenario when the range is changed, you load a new data set from the backend. In case you want to manually insert/remove/update the element in the eventSource array, you can call broadcast the 'eventSourceChanged' event to notify the controller manually.

Events

  • changeDate When receiving this event, the calendar will move the current view to previous or next range.
    Parameter: direction
    1 - Forward
    -1 - Backward

      $scope.$broadcast('changeDate', 1);
    
  • eventSourceChanged This event is only needed when you manually modify the element in the eventSource array.
    Parameter: value
    The whole event source object

      $scope.$broadcast('eventSourceChanged',$scope.eventSource);
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].