Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue : Model not opening and min & max dates #87

Open
thurimerla opened this issue Aug 29, 2018 · 2 comments
Open

Issue : Model not opening and min & max dates #87

thurimerla opened this issue Aug 29, 2018 · 2 comments

Comments

@thurimerla
Copy link

Hi @MishaSen,

I'm using this datepicker for my project. It is working for any new or demo project but while integrating with my existing project, it is showing error like below.

I followed your coding as it is in demo folder.
And I installed all peerDependencies as you mentioned in package.json

But is showing as below.

Error:

Error: Template parse errors:
Can't bind to 'min' since it isn't a known property of 'span'. ("-col col-1>
<span ion-datepicker [(ngModel)]="initDate" locale="en-US" [ERROR ->][min]='minDate' [max]='maxDate' clear class="ScheduleDate">
{{init"): ng:///AddmodifyproductstepsPageModule/datepickerpage.html@1472:87

Can't bind to 'max' since it isn't a known property of 'span'. ("<span ion-datepicker [(ngModel)]="initDate" locale="en-US" [min]='minDate' [ERROR ->][max]='maxDate' clear class="ScheduleDate">
{{initDate | date}}<io"): ng:///AddmodifyproductstepsPageModule/datepickerpage.html@1472:103

My datepickerpage.html code:

{{initDate | date}}

My datepickerpage.ts code:
import { DatePickerDirective } from "ion-datepicker";
@ViewChild(DatePickerDirective) public datepicker: DatePickerDirective;
public localDate: Date = new Date();
public initDate: Date = new Date();
public initDate2: Date = new Date(2015, 1, 1);
public minDate: Date = new Date(2017, 12, 31);
public maxDate: Date = new Date(2100, 12, 31);
public disabledDates: Date[] = [new Date(2017, 7, 14)];
public localeString = {
monday: true,
weekdays: ['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo'],
months: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
};
public min: Date = new Date();
constructor(public navCtrl: NavController,public actionsheetCtrl:ActionSheetController,
private viewCtrl: ViewController,public navParams: NavParams,public loadingCtrl: LoadingController,
public plt:Platform, private alertCtrl: AlertController, public toastCtrl: ToastController,
public ServicesService: ServicesService, public Camera: Camera) {
}
public ngOnInit() {
}
public Log(stuff): void {
this.datepicker.open();
this.datepicker.changed.subscribe(() => console.log('test'));
console.log(stuff);
}

public event(data: Date): void {
this.localDate = data;
}
setDate(date: Date) {
console.log(date);
this.initDate = date;
}

app.module.ts code:
*********;
*********;
import { DatePickerModule } from "ion-datepicker";
declarations: [
MyApp,
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
RouterModule,
RouterModule.forRoot(AppRoutes),
IonicModule.forRoot(MyApp, { scrollAssist: false, autoFocusAssist: false } ),
SuperTabsModule.forRoot(),
DatePickerModule,
DatepickerPage,
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
],
providers: [
StatusBar,
ServicesService,
AdminServices,
Config,
Enums,
ScreenOrientation,
SplashScreen,
Geolocation,
Camera,
Device,
AndroidPermissions,
{provide: ErrorHandler, useClass: IonicErrorHandler}
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA,
],

@misha130, Please help me

image

@thurimerla
Copy link
Author

Please help me anyone,

If you help me i ll be honored.

Thanks

@misha130
Copy link
Owner

Add DatePickerModule to AddmodifyproductstepsPageModule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants