Comments (8)
@danny-36 Could you provide your html code that declares the calendar directive?
from ionic-calendar.
@danny-36 I saw you closed this issue, is it solved?
from ionic-calendar.
no sorry. this is my template:
<ion-view view-title={{viewTitle}}>
<ion-nav-buttons side="right">
<button class="button" ng-disabled="isToday()" ng-click="today()">Today</button>
<button class="button" ng-click="changeMode('month')">M</button>
<button class="button" ng-click="changeMode('week')">W</button>
<button class="button" ng-click="changeMode('day')">D</button>
<button class="button" ng-click="loadEvents()">Load Events</button>
</ion-nav-buttons>
<ion-content scroll="false" class="main-content">
<calendar ng-model="calendar.currentDate" calendar-mode="calendar.mode" event-source="calendar.eventSource"
range-changed="reloadSource(startTime, endTime)"
event-selected="onEventSelected(event)"
title-changed="onViewTitleChanged(title)"
time-selected="onTimeSelected(selectedTime)"
all-day-label="Tutto il giorno"
step="30"></calendar>
</ion-content>
</ion-view>
from ionic-calendar.
Do you have below callback in your controller?
Could you set the breakpoint to see if it is called when the view is loaded?
$scope.onViewTitleChanged = function (title) {
$scope.viewTitle = title;
};
from ionic-calendar.
this is my controller:
angular.module('Events', ['ui.rCalendar'])
.controller('eventsCtrl', function($scope, $rootScope, webdesktop, $state, $stateParams, dataShare, calendarConfig) {
'use strict';
var currentSite = dataShare.getData();
$scope.calendar = {};
$scope.changeMode = function (mode) {
$scope.calendar.mode = mode;
};
$scope.loadEvents = function () {
$scope.calendar.eventSource = createRandomEvents();
};
$scope.onEventSelected = function (event) {
console.log('Event selected:' + event.startTime + '-' + event.endTime + ',' + event.title);
};
$scope.onViewTitleChanged = function (title) {
$scope.viewTitle = title;
};
$scope.today = function () {
$scope.calendar.currentDate = new Date();
};
$scope.isToday = function () {
var today = new Date(),
currentCalendarDate = new Date($scope.calendar.currentDate);
today.setHours(0, 0, 0, 0);
currentCalendarDate.setHours(0, 0, 0, 0);
return today.getTime() === currentCalendarDate.getTime();
};
$scope.onTimeSelected = function (selectedTime) {
console.log('Selected time: ' + selectedTime);
};
.... from this point code part to populate events in calendar
});
from ionic-calendar.
That's weird, your code is exactly the same as my demo page. Do you also define the ion-nav-bar as below?
Could you set the breakpoint on onViewTitleChanged method to see if it's triggered?
<ion-nav-bar class="bar-positive" align-title="left">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
from ionic-calendar.
That's weird, your code is exactly the same as my demo page. Do you also define the ion-nav-bar as below?
Could you set the breakpoint on onViewTitleChanged method to see if it's triggered?
<ion-nav-bar class="bar-positive" align-title="left">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
from ionic-calendar.
no I miss this part. now works. thank you very much.
from ionic-calendar.
Related Issues (20)
- Add bullets to the calendar events instead of background color HOT 1
- Runtime Error - Cannot not read property 'currentDate' of undefined
- How to select multiple events on same date HOT 1
- how did you implemented that tamplate HOT 1
- change the event color HOT 1
- How to change the viewTitle format for day HOT 4
- Refresh events on calander HOT 3
- view to a particular date HOT 4
- Will it work in a cordova project HOT 1
- How to move a day forward and backward with my own inputs? HOT 3
- How to highlight current day in week mode? HOT 3
- Not able to display month events HOT 5
- How to edit week.html and day.html? HOT 1
- EventSourceChanged not working. HOT 1
- Date format HOT 1
- Sliding Issue HOT 1
- Mark Dot Indicator For Event List length on monthviewEventDetailTemplate HOT 1
- not able to customise the style for cell HOT 1
- Dynamic step HOT 1
- upgrade to angular 16.x and ionic 5.x HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-calendar.