I would use a masked input with an entry initialized to a year. The field is then shown as valid even if a day or month are not entered. It lets the user know that they are optional.
[__/__/2019]
If they start entering a day the field becomes invalid (reddish background or border or invalid icon) until they enter a month.
It might be even better to revert the order, with YYYY/MM/DD
and put the cursor at the month position. They can correct the year (seeing it become invalid until a full year is entered) or continue entering a month and day.
The BC/AD option is tricky and I think putting the year first is a good solution for this too. It is obviously linked to the year and the +
suggests a -
is possible:
[+2019/__/__]
You need to handle years with less than 4 digits. To enter year -17
I feel it's natural to type -0017. This it not obvious and you might need to accept -17__
too.
Obviously a hint or help button giving more explanation and examples is always welcome.