Skip to content

Commit

Permalink
BDateTimePicker fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Emirhan Kudevi / Kuveyt Türk - BT-Kurumsal Mimari committed Apr 22, 2019
1 parent 19f05c4 commit f46d1ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/DateTimePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class DatePicker extends ComponentBase {
return (
<div
style={{
width: timeFormat ? '65%' : '100%',
width: (!timeFormat && this.props.fullWidth) ? '100%' : '65%',
}}
ref={r => (this.rootDate = r)}
>
Expand Down Expand Up @@ -416,7 +416,7 @@ class DatePicker extends ComponentBase {
return (
<div
style={{
width: '35%',
width: (!dateFormat && this.props.fullWidth) ? '100%' : '35%',
paddingLeft: 24,
}}
>
Expand Down
15 changes: 9 additions & 6 deletions packages/components/src/DateTimePicker/dateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,22 @@ export function getFormatDecomposition(format) {
timeFormat: undefined,
};
}
formats.dateFormatHint = Localization.stringLowerCase(
Localization.getDateTimeFormat(formats.dateFormat),
);
if (formats.dateFormat)
formats.dateFormatHint = Localization.stringLowerCase(
Localization.getDateTimeFormat(formats.dateFormat),
);
if (formats.timeFormat)
formats.timeFormatHint = Localization.stringLowerCase(
Localization.getDateTimeFormat(formats.timeFormat),
);

let dateMask = formats.dateFormatHint;
let timeMask = formats.timeFormatHint;
dateMask = dateMask.replaceAll('d', 'n');
dateMask = dateMask.replaceAll('m', 'n');
dateMask = dateMask.replaceAll('y', 'n');
if (dateMask) {
dateMask = dateMask.replaceAll('d', 'n');
dateMask = dateMask.replaceAll('m', 'n');
dateMask = dateMask.replaceAll('y', 'n');
}
if (timeMask) {
timeMask = timeMask.replaceAll('s', 'n');
timeMask = timeMask.replaceAll('h', 'n');
Expand Down
2 changes: 1 addition & 1 deletion stories/DateTimePicker/doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
"name": "bool"
},
"required": false,
"description": "If `false`, width property of the field is assigned 100.",
"description": "If `true`, width property of the field is assigned 100.",
"defaultValue": {
"value": true,
"computed": false
Expand Down

0 comments on commit f46d1ff

Please sign in to comment.