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] DatePickerView,DatePicker的mode模式异常,移除了原来的mode="time" #1350

Open
1 task done
inkCrazy opened this issue Jul 3, 2024 · 5 comments
Open
1 task done
Labels

Comments

@inkCrazy
Copy link

inkCrazy commented Jul 3, 2024

💬 Before You Start

  • I have searched the issues of this repository and believe that this is not a duplicate.

🙋 Description/Step to reproduce

DatePickerView的mode字段
老版本的mode="time"
WechatIMG549

新版本mode={'minute'},必须要显示出来年月日的选择吗
image

DatePicker的mode字段
/**
* Please use precision.
* Although it is also compatible with history, it will be removed in the future.
* @deprecated
*/

🔴 Version

9.8.1

💻 Environment

iOS, Android

⚫️ Output of npx react-native info

System:
OS: macOS 14.5
CPU: (10) arm64 Apple M2 Pro
Memory: 91.73 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.0.0
path: /usr/local/bin/node
Yarn:
version: 1.22.19
path: /opt/homebrew/bin/yarn
npm:
version: 9.8.1
path: /opt/homebrew/bin/npm
Watchman:
version: 2024.01.22.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /Users/inkcrazy/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "32"
- "33"
- "33"
- "34"
Build Tools:
- 28.0.3
- 29.0.2
- 29.0.3
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
- 34.0.0
System Images:
- android-31 | Android TV ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-UpsideDownCake | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.22
path: /Users/inkcrazy/.sdkman/candidates/java/current/bin/javac
Ruby:
version: 3.0.0
path: /Users/inkcrazy/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.2
wanted: 0.74.2
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Additional comments

怎么样才能去掉不需要的前面几列。

No response

@1uokun
Copy link
Collaborator

1uokun commented Jul 3, 2024

现在和antd-mobile的DatePicker对齐了,你可以改用Picker+自定义data实现(2列数据还是比较简单的)

<Picker
  data={[
    [
      { label: '1时', value: 1 },
      { label: '2时', value: 2 },
      { label: '3时', value: 3 },
      ...
      { label: '12时', value: 12 },
    ],
    [
      { label: '0分', value: 0 },
      { label: '1分', value: 1 },
      { label: '2分', value: 2 },
      ...
      { label: '59分', value: 59 },
    ],
  ]}
  cascade={false}
  cols={2}
 >

@inkCrazy
Copy link
Author

inkCrazy commented Jul 3, 2024

现在和antd-mobile的DatePicker对齐了,你可以改用Picker+自定义data实现(2列数据还是比较简单的)

<Picker
  data={[
    [
      { label: '1时', value: 1 },
      { label: '2时', value: 2 },
      { label: '3时', value: 3 },
      ...
      { label: '12时', value: 12 },
    ],
    [
      { label: '0分', value: 0 },
      { label: '1分', value: 1 },
      { label: '2分', value: 2 },
      ...
      { label: '59分', value: 59 },
    ],
  ]}
  cascade={false}
  cols={2}
 >

能用,一些必要的控制得自己写了,value,minDate,maxDate.

@inkCrazy
Copy link
Author

inkCrazy commented Jul 4, 2024

现在和antd-mobile的DatePicker对齐了,你可以改用Picker+自定义data实现(2列数据还是比较简单的)

<Picker
  data={[
    [
      { label: '1时', value: 1 },
      { label: '2时', value: 2 },
      { label: '3时', value: 3 },
      ...
      { label: '12时', value: 12 },
    ],
    [
      { label: '0分', value: 0 },
      { label: '1分', value: 1 },
      { label: '2分', value: 2 },
      ...
      { label: '59分', value: 59 },
    ],
  ]}
  cascade={false}
  cols={2}
 >

value显示有点丑啊,可以自定义格式吗,我没看到字段
image

@inkCrazy
Copy link
Author

好多地方都用了,改动太大了

@1uokun 1uokun added the 有偿服务 Paid services label Sep 19, 2024
@inkCrazy
Copy link
Author

现在和antd-mobile的DatePicker对齐了,你可以改用Picker+自定义data实现(2列数据还是比较简单的)

<Picker
  data={[
    [
      { label: '1时', value: 1 },
      { label: '2时', value: 2 },
      { label: '3时', value: 3 },
      ...
      { label: '12时', value: 12 },
    ],
    [
      { label: '0分', value: 0 },
      { label: '1分', value: 1 },
      { label: '2分', value: 2 },
      ...
      { label: '59分', value: 59 },
    ],
  ]}
  cascade={false}
  cols={2}
 >

value显示有点丑啊,可以自定义格式吗,我没看到字段 image

看到这个属性了:

format 格式化选中值的函数,用于回显在extra属性上 (labels: string[]): any (labels) => { return labels.join(','); }

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

No branches or pull requests

2 participants