Skip to content

Commit e746ee9

Browse files
committed
Merge branch '3.37'
2 parents 8feb921 + 21151c0 commit e746ee9

File tree

7 files changed

+35
-25
lines changed

7 files changed

+35
-25
lines changed

packages/openchs-android/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openchs-android/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"lodash": "4.17.21",
5151
"moment": "2.29.4",
5252
"native-base": "3.4.9",
53-
"openchs-models": "1.27.23",
53+
"openchs-models": "1.27.25",
5454
"prop-types": "15.8.1",
5555
"react": "18.2.0",
5656
"react-native": "0.69.7",

packages/openchs-android/src/utility/General.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ class General {
7373
return `${General.toTwoChars(date.getDate())}-${General.toTwoChars(date.getMonth() + 1)}-${date.getFullYear()} ${hour}:${minutes}`;
7474
}
7575

76+
static to12HourDateTimeFormat(dateTime) {
77+
return moment(dateTime).format("lll");
78+
}
79+
80+
static to12HourDateFormat(dateTime) {
81+
return moment(dateTime).format("ll");
82+
}
83+
7684
static isoFormat(date) {
7785
return `${date.getFullYear()}-${General.toTwoChars(date.getMonth() + 1)}-${General.toTwoChars(date.getDate())}`;
7886
}

packages/openchs-android/src/views/primitives/DatePicker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class DatePicker extends AbstractComponent {
3333
return _.isNil(date)
3434
? this.I18n.t(noDateMessageKey)
3535
: (this.props.pickTime && !(General.hoursAndMinutesOfDateAreZero(date)))
36-
? General.formatDateTime(date)
37-
: General.formatDate(date);
36+
? General.to12HourDateTimeFormat(date)
37+
: General.to12HourDateFormat(date);
3838
}
3939

4040
showDatePicker() {
4141
const datePickerOptions = {
4242
mode: 'date',
4343
display: _.isNil(this.props.datePickerMode) ? 'calendar' : this.props.datePickerMode,
44-
is24Hour: true,
44+
is24Hour: false,
4545
onChange: (event, date) => this.onDateChange(event, date),
4646
value: _.isNil(this.props.dateValue) ? new Date() : this.props.dateValue
4747
};
@@ -72,7 +72,7 @@ class DatePicker extends AbstractComponent {
7272
const timePickerOptions = {
7373
mode: 'time',
7474
display: timePickerDisplay,
75-
is24Hour: true,
75+
is24Hour: false,
7676
onChange: (event, date) => this.onTimeChange(event, date),
7777
value: date
7878
};

packages/openchs-android/src/views/primitives/TimePicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class TimePicker extends AbstractComponent {
3333
const options = {
3434
mode: "time",
3535
display: timePickerDisplay,
36-
is24Hour: true,
36+
is24Hour: false,
3737
onChange: (event, date) => this.onTimeChange(event, date),
3838
value: _.isNil(this.props.timeValue) ? new Date() : General.toDateFromTime(this.props.timeValue)
3939
};
@@ -65,7 +65,7 @@ class TimePicker extends AbstractComponent {
6565

6666
timeDisplay() {
6767
return _.isNil(this.props.timeValue)
68-
? this.I18n.t(this.noTimeMessageKey) : this.props.timeValue;
68+
? this.I18n.t(this.noTimeMessageKey) : General.toDisplayTime(this.props.timeValue);
6969
}
7070

7171
showTimePicker(options) {

packages/openchs-android/src/views/program/GrowthChartView.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,38 @@ class GrowthChartView extends AbstractComponent {
2626

2727
settings = {
2828
SD3neg: {
29-
label: "Grade 3",
29+
label: this.I18n.t('Grade 3'),
3030
config: {
3131
color: processColor("red"),
3232
fillColor: processColor("red"),
3333
fillAlpha: 150
3434
}
3535
},
3636
SD2neg: {
37-
label: "Grade 2",
37+
label: this.I18n.t('Grade 2'),
3838
config: {
3939
color: processColor("orange"),
4040
fillColor: processColor("orange"),
4141
fillAlpha: 150
4242
}
4343
},
4444
SD0: {
45-
label: "Grade 1",
45+
label: this.I18n.t('Grade 1'),
4646
config: {
4747
color: processColor("green"),
4848
fillColor: processColor("green"),
4949
fillAlpha: 30
5050
}
5151
},
5252
SD2: {
53-
label: "Grade 1",
53+
label: this.I18n.t('Grade 1'),
5454
config: {
5555
color: processColor("green"),
5656
fillColor: processColor("green"),
5757
}
5858
},
5959
SD3: {
60-
label: "Grade 1",
60+
label: this.I18n.t('Grade 1'),
6161
config: {
6262
color: processColor("green"),
6363
fillColor: processColor("green"),
@@ -242,7 +242,7 @@ class GrowthChartView extends AbstractComponent {
242242
maxSizePercent: 0.5,
243243
custom: {
244244
colors: [processColor('black'), processColor('green'), processColor("orange"), processColor("red")],
245-
labels: [this.getLegendLabel(), "Grade 1", "Grade 2", "Grade 3"]
245+
labels: [this.I18n.t(this.getLegendLabel()), this.I18n.t('Grade 1'), this.I18n.t('Grade 2'), this.I18n.t('Grade 3')]
246246
}
247247
};
248248
const marker = {
@@ -272,23 +272,25 @@ class GrowthChartView extends AbstractComponent {
272272
style={[GrowthChartView.style.graphButton.self, wfaStyle.self]}
273273
_text={wfaStyle.text}
274274
onPress={() => this.onGraphSelected(this.states.weightForAge)}>
275-
{this.states.weightForAge}
275+
{this.I18n.t(this.states.weightForAge)}
276276
</Button>
277277

278278
<Button
279279
style={[GrowthChartView.style.graphButton.self, hfaStyle.self]}
280280
_text={hfaStyle.text}
281-
onPress={() => this.onGraphSelected(this.states.heightForAge)}>{this.states.heightForAge}
281+
onPress={() => this.onGraphSelected(this.states.heightForAge)}>
282+
{this.I18n.t(this.states.heightForAge)}
282283
</Button>
283284

284285
<Button
285286
style={[GrowthChartView.style.graphButton.self, wfhStyle.self]}
286287
_text={wfhStyle.text}
287-
onPress={() => this.onGraphSelected(this.states.weightForHeight)}>{this.states.weightForHeight}
288+
onPress={() => this.onGraphSelected(this.states.weightForHeight)}>
289+
{this.I18n.t(this.states.weightForHeight)}
288290
</Button>
289291
</View>
290292

291-
<Text style={[Styles.formGroupLabel, {paddingLeft: 4}]}>{this.state.title}</Text>
293+
<Text style={[Styles.formGroupLabel, {paddingLeft: 4}]}>{this.I18n.t(this.state.title)}</Text>
292294

293295
<View style={styles.container}>
294296
<LineChart

packages/openchs-android/src/views/task/TaskCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class TaskCard extends AbstractComponent {
6666
const dateOptions = {
6767
mode: 'date', //To only enable date selection
6868
display: 'calendar', //Type of DatePicker
69-
is24Hour: true,
69+
is24Hour: false,
7070
onChange: (event, date) => this.onDateChange(event, date, task),
7171
value: task.scheduledOn
7272
};

0 commit comments

Comments
 (0)