Civil Code Section 1954 defines when a landlord may enter an apartment. 24 hour written notice of entry for repairs is required. 24 hour oral notice is allowed to exhibit the dwelling to show to prospective purchasers or tenants if previous written notice is given.
Landlord and tenant can agree to oral notice giving approximate time and date of entry.
Of course in an emergency landlord can enter without notice.
In your case it is not worth taking hard line. In a fight between you and landlord you will always come out second. If the landlord wants to come at an inconvenient time for you, call them and schedule it for a more convenient time.
The response given is not intended to create, nor does it create an ongoing duty to respond to questions. The response does not form an attorney-client relationship, nor is it intended to be anything other than the educated opinion of the author. It should not be relied upon as legal advice. The response given is based upon the limited facts provided by the person asking the question. To the extent additional or different facts exist, the response might possibly change. Attorney is licensed to practice law only in the State of California. Responses are based solely on California law unless stated otherwise.
The landlord can also enter when you're present, without notice, with your consent. If you want the repairs to be done, it's not in your interest to withhold your consent for no reason.
Disclaimer: Please note that this answer does not constitute legal advice, and should not be relied on, since each state has different laws, each situation is fact specific, and it is impossible to evaluate a legal problem without a comprehensive consultation and review of all the facts and documents at issue. This answer does not create an attorney-client relationship.