davecoffin / nativescript-modal-datetimepicker

Apache License 2.0
59 stars 36 forks source link

Date picker doesn't fit inside modal #44

Closed saikksub closed 5 years ago

saikksub commented 5 years ago

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

  1. Install this plugin tns plugin add nativescript-modal-datetimepicker
  2. Configure style inside resource folder: (As instructed in official documentation)
    
    <!-- Default style for DatePicker - in spinner mode -->
    <style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
    <item name="android:datePickerMode">calendar</item>
    </style>
2. In your NativeScript-Vue component import and initialise dependency:

const ModalPicker = require("nativescript-modal-datetimepicker").ModalDatetimepicker const picker = new ModalPicker()

3. on Click any method, run this code:
 picker.pickDate({
    title: "Select Your Birthday",
    theme: "light",
    maxDate: new Date()
  }).then(result => {
    // Note the month is 1-12 (unlike js which is 0-11)
    console.log(
      "Date is: " + result.day + "-" + result.month + "-" + result.year
    )
    var jsdate = new Date(result.year, result.month - 1, result.day);
  }).catch(error => {
    console.log("Error: " + error);
  })

### Is there any code involved? 
Entire component code is-


# Final Result:
![screenshot_20181207-131555](https://user-images.githubusercontent.com/35134207/49634339-69766900-fa22-11e8-8390-6397c536dd61.png)
saikksub commented 5 years ago

Android OS version is 7.0, Device is Moto G4 plus

shiv19 commented 5 years ago

Duplicate of #15