Skip to content

Commit

Permalink
fixed arrow buttons bug when in week or day view modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron Schmitt committed Dec 27, 2021
1 parent 845cdf4 commit aa66e23
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
13 changes: 7 additions & 6 deletions projects/ngx-mat-tui-calendar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Development Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![GitHub stars](https://img.shields.io/github/stars/ron2015schmitt/ngx-mat-tui-calendar.svg)](https://github.com/ron2015schmitt/ngx-mat-tui-calendar/stargazers)
![GitHub downloads all releases](https://img.shields.io/github/downloads/ron2015schmitt/ngx-mat-tui-calendar/total)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/ron2015schmitt/ngx-mat-tui-calendar)

[![npm](https://img.shields.io/npm/v/ngx-mat-tui-calendar?label=npm%20package)](https://www.npmjs.com/package/ngx-mat-tui-calendar)
Expand All @@ -28,6 +27,9 @@ The top-level `angular.json` and `package.json` files are used for building both

This repo was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.3. Angular ^12.2 requires node ^v14.15 (npm ^v6.14).

# Online Demo

https://ngx-mat-tui-calendar-demo.netlify.app/

# UI
## Month View
Expand All @@ -48,7 +50,7 @@ This repo was generated with [Angular CLI](https://github.com/angular/angular-cl

Install via npm:
```bash
npm i --save ngx-mat-tui-calendar
npm i --save ngx-mat-tui-calendar --legacy-peer-deps
```
which will add `ngx-mat-tui-calendar`, as well as all of its dependencies to your `package.json` file.

Expand All @@ -71,12 +73,11 @@ Set up an [Angular theme](https://material.angular.io/guide/theming). For examp

A demonstration of the simple usage described above can be found at repo https://github.com/ron2015schmitt/ngx-mat-tui-calendar-quickstart

## Demo Repo
### Demo Repo

A more extensive demonstration of usage can be found at repo https://github.com/ron2015schmitt/ngx-mat-tui-calendar-demo

### Stackblitz
*Coming soon*


# Documentation

Expand Down Expand Up @@ -115,7 +116,7 @@ Selector: `ngx-mat-tui-calendar`
```bash
git clone https://github.com/ron2015schmitt/ngx-mat-tui-calendar
cd ngx-mat-tui-calendar
npm install
npm install --legacy-peer-deps
ng build
ng serve
```
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-mat-tui-calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-mat-tui-calendar",
"version": "12.0.9",
"version": "12.0.10",
"author": "ron schmitt",
"license": "MIT",
"description": "Angular Material Design wrapper, supporting theming, for the Toast UI Calendar, suitable for web-based scheduling, events, appointments, and day planner applications.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,22 @@ export class NgxMatTuiCalendarComponent implements OnInit, OnChanges, OnDestroy
date.setMonth(date.getMonth() + months); // date class does the modular arithmetic
date.setDate(date.getDate() + days); // date class does the modular arithmetic
this.calendar.setDate(date);
this.calendar.toggleScheduleView(true);
}

onCalendarPrev() {
this.calendar.prev();
this.calendar.toggleScheduleView(true);
}

onCalendarToday() {
this.calendar.today();
this.calendar.toggleScheduleView(true);
}

onCalendarNext() {
this.calendar.next();
this.calendar.toggleScheduleView(true);
}

onCalendarLongNext() {
Expand All @@ -156,6 +160,7 @@ export class NgxMatTuiCalendarComponent implements OnInit, OnChanges, OnDestroy
date.setMonth(date.getMonth() + months); // date class does the modular arithmetic
date.setDate(date.getDate() + days); // date class does the modular arithmetic
this.calendar.setDate(date);
this.calendar.toggleScheduleView(true);
}


Expand All @@ -164,7 +169,9 @@ export class NgxMatTuiCalendarComponent implements OnInit, OnChanges, OnDestroy
}

onWeekView() {
console.log(`onWeekView`)
this.calendar.changeView('week');
this.calendar.render(true); // <-- so that selection is cleared
}

onDayView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { FlexModule, FlexLayoutModule } from '@angular/flex-layout';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { OverlayModule } from '@angular/cdk/overlay';

// Angular Material Design modules
Expand Down Expand Up @@ -86,5 +86,6 @@ const projectModules = [
entryComponents: [
...projectModules,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class NgxMatTuiCalendarModule { }

0 comments on commit aa66e23

Please sign in to comment.