import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../../../../resource/assets.gen.dart';
import '../../../../utils/age_zodiac_sign_util.dart';

mixin StepBirthdayLogic {
  final tag = "StepBirthdayLogic";
  DateTime initialDate = DateTime.now();

  // 最小日期
  var minimumDate = DateTime.parse("1921-01-01");


  //星座
  Rx<Zodiac> constellation = Rx<Zodiac>(AgeZodiacSignUtil.getZodiacSign(DateTime.now()));

  var age = 0.obs;

  final Rxn<DateTime> _currentBirthday = Rxn<DateTime>(null);

  DateTime? get currentBirthday => _currentBirthday.value;

  updateConstellation(DateTime date) {
    constellation.value = AgeZodiacSignUtil.getZodiacSign(date);
    age.value = AgeZodiacSignUtil.calculateAge(date);
    _currentBirthday.value = date;
    initialDate = date;
    print("星座：${constellation.value}");
    print("年龄：${age.value}");
    print("日期：${date}");

  }
}
