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

bug: min and max ignored when setting time in datetime mode #220

Closed
5 of 24 tasks
beard7 opened this issue Jul 3, 2024 · 2 comments
Closed
5 of 24 tasks

bug: min and max ignored when setting time in datetime mode #220

beard7 opened this issue Jul 3, 2024 · 2 comments
Labels
bug/fix Something isn't working package: datetime-picker platform: android Android platform

Comments

@beard7
Copy link

beard7 commented Jul 3, 2024

Plugin(s)

  • Android Foreground Service
  • Android Battery Optimization
  • App Update
  • Background Task
  • Badge
  • Bluetooth Low Energy
  • Cloudinary
  • Datetime Picker
  • File Compressor
  • File Opener
  • File Picker
  • Live Update
  • Managed Configurations
  • NFC
  • Photo Editor
  • Printer
  • Screen Orientation
  • Zip

Version

5.1.1

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

Using the DatetimePicker with the following options on Android allows choosing a time outside the specified min/max range:

options = {
  cancelButtonText: 'Cancel',
  doneButtonText: 'Ok',
  mode: "datetime",
  format: "yyyy-MM-dd'T'HH:mm",
  value: "2024-07-03T06:28",
  min: "2024-07-03T03:00",
  max: "2024-07-03T09:00",
  theme: 'dark',
  locale: 'en-GB',
  androidTimePickerMode: 'clock',
  androidDatePickerMode: 'calendar',
};

All other aspects of the plugin are working as expected. Setting mix/max works well in date mode.

Expected behavior

After selecting the date, the time should be limited to the range specified by the min/max options.

Reproduction

.

Steps to reproduce

import { DatetimePicker } from '@capawesome-team/capacitor-datetime-picker';
options = {
  cancelButtonText: 'Cancel',
  doneButtonText: 'Ok',
  mode: "datetime",
  format: "yyyy-MM-dd'T'HH:mm",
  value: "2024-07-03T06:28",
  min: "2024-07-03T03:00",
  max: "2024-07-03T09:00",
  theme: 'dark',
  locale: 'en-GB',
  androidTimePickerMode: 'clock',
  androidDatePickerMode: 'calendar',
};
const result = await DatetimePicker.present(options);

Other information

If it's of any use, the same issue seems to apply when using the alternative @capacitor-community/date-picker plugin.

Capacitor doctor

Latest Dependencies:

@capacitor/cli: 6.1.0
@capacitor/core: 6.1.0
@capacitor/android: 6.1.0
@capacitor/ios: 6.1.0

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/cli: 5.2.2
@capacitor/android: 5.2.2
@capacitor/core: 5.2.2

[error] Missing attribute in app/src/main

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
@robingenz
Copy link
Member

I could reproduce this issue. However, the problem does not seem to be the plugin but Android. The plugin passes the value correctly to setMinDate/setMaxDate. Unfortunately there is nothing I can do. Therefore I close this issue.

@robingenz robingenz closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
@beard7
Copy link
Author

beard7 commented Jul 4, 2024

Thanks for looking. I thought that may be the case, given that it affects the other Capacitor datetime picker in the same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/fix Something isn't working package: datetime-picker platform: android Android platform
Projects
None yet
Development

No branches or pull requests

2 participants