```
import Context from '@ohos.app.ability.common';
import CommonUtils from '../common/utils/CommonUtils';
import {CommonConstants} from '../common/constants/CommonConstants';
import TextInputWidget from '../view/TextInputWidget';
import TextCommonWidget from '../view/TextCommonWidget';
import CustomDialogWidget from '../view/CustomDialogWidget';
import Logger from '../common/utils/Logger';
aboutToAppear() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + CommonConstants.PLUS_ONE;
let day = date.getDate();
this.birthdate = CommonUtils.getBirthDateValue(year, month, day);
let context = getContext(this);
if ((CommonUtils.isEmpty(context)) || (CommonUtils.isEmpty(context.resourceManager))) {
Logger.error(CommonConstants.TAG_HOME, 'context or resourceManager is null');
return;
}
let manager = context.resourceManager;
manager.getStringValue($r('app.string.default_sex').id, (error, sexValue) => {
if (!CommonUtils.isEmpty(error)) {
Logger.error(CommonConstants.TAG_HOME, 'error = ' + JSON.stringify(error));
} else {
this.sex = sexValue;
}
});
}