Joseph Adalberto Ramirez, 31, was ordered held on $2 million bail. A group of at least 20 people was in the courtroom to show support for the defendant.Deputy District Attorney Scott Pirrello told Judge David Szumowski that Ramirez took his family to the cemetery Saturday around 4:30 p.m. to visit his uncle's grave.Ramirez was accompanied by his son, Daniel, his two daughters -- ages 3 and 18 months -- and their mother, the prosecutor said.As the defendant was setting up dinner by candlelight, he said it was "time for his family to go to heaven," Pirrello told the judge.The mother unsuccessfully tried to wrest the children away from the defendant, then ran to her car and started honking the horn, ultimately flagging down some good Samaritans, according to the prosecutor.Ramirez was heard to say, "It's Daniel's time to go," before slashing both of his son's forearms with a broken piece of glass, the prosecutor alleged.As the attack unfolded, the victim was telling his father, "'Don't hurt me, Daddy. Don't hurt me,'" Pirrello told the judge.One of the good Samaritans was eventually able to get Ramirez's daughters and then his son away from him, the prosecutor said. Ramirez ran but was tackled by a security guard.The boy was taken to Rady Children's Hospital for treatment of the cuts on his arms. His father was also taken to a hospital for treatment of self-inflicted wounds to his forearms, police said.Ramirez told police that his dead grandmother told him to sacrifice his son, according to Officer David Stafford.If convicted, Ramirez faces 13 years in state prison.A status conference was set for May 9 and a preliminary hearing for May 15.