Local notification in ionic 2


I am trying to implement local notification to ionic 2. I am following this https://ionicframework.com/docs/native/local-notifications/.
And I am able to set local notification , but I can set by hard coding time value in seconds. Eg.
Notification 5 seconds after I set

text: ‘You will get this notification after 5 seconds’,
at: new Date(new Date().getTime() + 5*1000),
led: ‘FF0000’,
sound: null

But I need user to choose date and time and set notification respectively. I am taking date and time from user in prompt, like below,

let prompt = this.alertCtrl.create({
title: ‘FOLLOW UP’,
message: “Details for Reminder :”,
inputs: [
name: ‘notificatioDate’,
placeholder: ‘notificatioDate’,
name: ‘notificatioTtime’,
placeholder: ‘notificationTime’,
name: ‘remarks’,
placeholder: ‘Remarks’,
// type:‘Number’
buttons: [
text: ‘Cancel’,
handler: data => {
console.log(‘Cancel clicked’);
text: ‘Save’,
handler: data => {
console.log(‘Saved clicked’+data.remarks);


Pl. help


Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.