xtianus79 / multiple-date-picker-angular

Multiple Date Picker for Angular: This includes Angular 2+ / 4+ / 5+ to utilize a lightweight and clean calendar allowing user to select multiple dates, single, use custom callback on (de)selection. You can also specify off days or already selected days. You can also select a range of dates with start and end inputs... This will also calculate all the days inbetween.
http://xtianus79.github.io/MultipleDatePicker
MIT License
14 stars 19 forks source link

highlight days not working #8

Closed arunw3 closed 6 years ago

arunw3 commented 6 years ago

I'm trying to highlight days but it is not getting highlighted, there are no console errors. Below is my code for highlighting the day's. Please let me know what is wrong in my code AppComponent

import { Component, OnInit, Input, AfterViewInit, ViewChild } from '@angular/core';
import * as moment from 'moment/moment';
@Component({
  selector: 'app-root',
  template: `<multiple-date-picker [highlightDays]="highlightDays"></multiple-date-picker>`,
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
  highlightDays: any[]; 
  ngOnInit() 
  {
    this.highlightDays = [
      {date: moment().date(12).valueOf(), css: 'holiday', selectable: false, title: 'Holiday time !'},
      {date: moment().date(25).valueOf(), css: 'off', selectable: false, title: 'We don\'t work today'},
      {date: moment().date(30).valueOf(), css: 'birthday', selectable: true, title: 'I\'m thir... i\'m 28, seriously, I mean ...'}
   ];
  }
}

AppModule

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule} from '@angular/forms';
import { AppComponent } from './app.component';
import { MultipleDatePickerModule } from 'multiple-date-picker-a2';
@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    MultipleDatePickerModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
xtianus79 commented 6 years ago

why are you not importing this?

  import { MultipleDatePicker, DateRangeHelper } from '../multiple-date-picker/index';
arunw3 commented 6 years ago

Even with that it is not working. But other properties like showDaysOfSurroundingMonths & weekdayoff are working

xtianus79 commented 6 years ago

what version of angular are you using?

arunw3 commented 6 years ago

I'm using 4.4.6

xtianus79 commented 6 years ago

ok if there are no errors... how about checking the css in the console to make sure the tags for that date have the correct tagging.... if they do then see if a color is being loaded for that new tag. let me know if that is what the issue is

arunw3 commented 6 years ago

after updating the plugin to 3.0.0 it started to work 👍 . Also is there any property to disable the user selection for the entire calendar?

xtianus79 commented 6 years ago

@arunw3 I don't believe so but I can see the utility is warranted. Also, there are other ways to achieve this through the interface. i'll look into it.