You would think so, but there isn't. Even if it is a child custody case. Even if you have a subpoena. I worked one place that would let you off if you were a witness in a criminal case or had jury duty (because it was law), but never for a civil case. After all, you should have conducted your personal life in such a way that it didn't interfere with work.
Of course, this was a state that didn't require any reason to fire you. Sometimes folks could get unemployment afterwards, sometimes not.
Perhaps there should, but these laws are generally toothless and unenforceable because of the power structure in a place of business: in the US employment is "at will" so even if on paper it says you can't be fired for this, it is easy for bosses to invent some justification for the firing, and to make it known subtly or not so subtly that missing work for any reason legal or not will result in consequences. Employers can and do do this right now, all the time: "wow look at John, he worked through lunch and worked unpaid overtime until 6. He is really dedicated. He's employee of the month. You should all be more like John. He definitely won't be laid off next week."
Without a competing power structure to hold employers accountable and keep an eye on their behavior (i.e. a union) the law is a nice sentiment but not much more.