@momo-kits/date-picker 0.0.62-alpha.16 → 0.0.62-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,10 +67,12 @@ const styles = StyleSheet.create({
67
67
 
68
68
  const getStrings = (strings) =>
69
69
  strings?.length === 1 ? `0${strings}` : strings;
70
+
70
71
  class DatePicker extends Component {
71
72
  constructor(props) {
72
73
  super(props);
73
74
  this.initDefault(props);
75
+ console.log('PRops------------', props);
74
76
  }
75
77
 
76
78
  // onBackPress = () => {
@@ -224,8 +226,6 @@ class DatePicker extends Component {
224
226
  this.minutes = DatePickerHelper.makeRange(0, 59, true);
225
227
  }
226
228
  this.ranged = rangeHour || DatePickerHelper.arrayRange;
227
- this.startTime = startTime || DatePickerHelper.arrayRange;
228
- this.endTime = endTime || DatePickerHelper.arrayRange;
229
229
  }
230
230
 
231
231
  selectedIndexDate() {
@@ -251,6 +251,9 @@ class DatePicker extends Component {
251
251
  this.selectedDate?.to?.getMinutes()?.toString(),
252
252
  )}`
253
253
  : '00:00';
254
+ console.log('Value hour 1', this.selectedDate.from);
255
+ console.log('Value hour 2', this.selectedDate.to);
256
+ console.log('Selected date', this.selectedDate);
254
257
  this.hourRangeIndex_1 = valueHours_1
255
258
  ? this.ranged.indexOf(valueHours_1)
256
259
  : this.ranged.indexOf(
@@ -358,8 +361,12 @@ class DatePicker extends Component {
358
361
  if (isRanged && format === 'hh:mm') {
359
362
  const from = this.ranged[this.hourRangeIndex_1];
360
363
  const to = this.ranged[this.hourRangeIndex_2];
364
+
361
365
  if (onSelected && typeof onSelected === 'function') {
362
- onSelected({ from, to });
366
+ onSelected({
367
+ from,
368
+ to,
369
+ });
363
370
  }
364
371
  this.hide();
365
372
  return;
@@ -540,6 +547,7 @@ class DatePicker extends Component {
540
547
  if (!this.arrayRef) {
541
548
  this.arrayRef = {};
542
549
  }
550
+ console.log('valueInput------------', valueInput);
543
551
  return (
544
552
  <WheelPicker
545
553
  bottomOffset={bottomOffset}
@@ -612,6 +620,7 @@ class DatePicker extends Component {
612
620
  labelHour,
613
621
  isRanged,
614
622
  } = this.props;
623
+
615
624
  if (isRanged && format === 'hh:mm') {
616
625
  return (
617
626
  <View style={styles.container}>
@@ -620,7 +629,7 @@ class DatePicker extends Component {
620
629
  {this.renderColumn(
621
630
  'HourRange1',
622
631
  this.hourRangeIndex_1,
623
- this.startTime,
632
+ this.ranged,
624
633
  SwitchLanguage.from,
625
634
  bottomOffset,
626
635
  (value) => {
@@ -631,7 +640,7 @@ class DatePicker extends Component {
631
640
  {this.renderColumn(
632
641
  'HourRange2',
633
642
  this.hourRangeIndex_2,
634
- this.endTime,
643
+ this.ranged,
635
644
  SwitchLanguage.to,
636
645
  bottomOffset,
637
646
  (value) => {
@@ -32,6 +32,7 @@ export default class WheelPicker extends Component {
32
32
 
33
33
  componentDidMount() {
34
34
  const { value } = this.props;
35
+ console.log(value);
35
36
  this.scrollToPosition(value);
36
37
  }
37
38
 
@@ -186,7 +187,11 @@ export default class WheelPicker extends Component {
186
187
  const { items, value, width } = this.state;
187
188
  const { preFix, bottomOffset } = this.props;
188
189
  return (
189
- <View style={{ flex: 1, height: heightContain + 40 }}>
190
+ <View
191
+ style={{
192
+ flex: 1,
193
+ height: heightContain + 40,
194
+ }}>
190
195
  <Text.Description2
191
196
  weight="semibold"
192
197
  style={{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/date-picker",
3
- "version": "0.0.62-alpha.16",
3
+ "version": "0.0.62-alpha.18",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "dependencies": {},