Hemdat Yamim is a book dealing with Jewish customs and laws, including many musar exhortations. It is based on kabbalahin general, and the kabbalah of the Ari in particular. The book was first published by Israel Yaakov Algazi in Izmir in about 1731. The question of the authorship and nature of the book - whether early or late, whether or not the author was a Sabbatean - were once in dispute, and as a result also the attitude towards customs recorded in the book.
Sabbateanism and the book
Sabbatai Zevi died 54 years before the publication of Hemdat Yamim. The book included songs with the acrostic "Natan HaAzati", as well as statements known to be attributed to Sabbateans. Today, it is agreed by academic scholars that the book consists of a collection, most of which is derived from kabbalistic writings from the Ari's school or other customs and laws which are not sourced on Sabbateanism, from a variety of periods and sources, while omitting the original names. Earlier, some had thought that the author of Hemdat Yamim, including its customs, was Nathan of Gaza or another, later, Sabbatean author. In Orthodox Judaism there was a vociferous disagreement regarding whether the book was Sabbatean. It became famous with R' Yaakov Emden's protesting of the alleged Sabbateanism of R' Jonathan Eybeschutz, and even more so with the publication of maskil David Kohn's book Even HaToim. Most rabbis distanced themselves from the book, but some Hasidic rabbis adopted its customs, and even studied it, while distancing themselves from parts that were definitively identified with Sabbateanism.
Authorship
The book was first printed in Izmir in 1731-1732, and brought to the printing press by R' Israel Yaakov Algazi, who wrote that he found the manuscript in Safed, without naming the author. In his introduction to the book, he praises it and the greatness of its author, and describes how he acquired the manuscript. R' Yaakov Emden argued that the author was Nathan of Gaza. In 1954, the book "Taalumat Sefer" by Avraham Yaari was published, which theorized that the author was the judge Binyamin Halevi, a student of the Ari, who lived prior to Shabtai Zevi and Sabbateanism. In 2008, R' Shlomo Kosovski Shachor published the book "Otzar Hemdat Yamim", which further established this opinion. In the long introduction to one edition of the book, R' Moshe Tzuriel wrote a response to the views which argue against the book. Yaari, for his part, argued that the poem in Hemdat Yamim with the acrostic "Nathan of Gaza" was not part of the original body of the book. Gershon Scholem disagreed with this conclusion, arguing that Nathan of Gaza was indeed the author. Historian Meir Benayahu argued that book's author was apparently R' Israel Yaakov Algazi himself. Algazi was the rabbi of the Hida, and the father of R' Yom Tov Algazi, regarding who the question of his Sabbateanism is debated to this day. Today, academic scholars believe that the book consists of a long compilation of excerpts, with changes of language, of books from various periods, mostly predating Sabbateanism; and that the compiler was R' Yisrael Yaakov Algazi himself. The proof to this is linguistic: phrasing which were changed from the original sources, which are unique to Algazi, recur many times throughout the book; and in the first printed edition of the book, in one of Algazi's notes is found the apparent admission that he himself composed the book. There are still some scholars who believe that some of the customs in the book, as well as the writing of the book, are to be attributed to Algazi or his helpers, or at least that their source is Sabbatean.
Content and influence
The book is significant in that many of its customs are now widely followed. Its content is widely spread with kabbalistic-style musar and inspirational exhortations. It is one of the sources for customs of Tu Bishvat celebration, and the source for the tikkun of the seventh night of Passover which is practiced on Sephardic communities. In new editions of Hemdat Yamim, at the beginning of the book is printed a list of dozens of now-accepted customs whose only known source is this book. The book has been extensively used primarily by Sephardic rabbis, and various kabbalistic customs in it were accepted by all Jewish communities. Opinion among Hasidim about the book varied. R' Chaim of Volozhin wrote that even if the book was authored by Nathan of Gaza, the book itself contained no objectionable content, and seemingly was written before Nathan developed his Sabbatean views. R' Shlomo Elyashiv described the book as "one of the most holy". A 2003 printing of the book opened with a haskama from R' Ovadiah Yosef, saying that "excitement about the holiness of Shabbat and holidays does not enter my heart, except by reading this book of Torah". On the other hand, R' Mordechai Eliyahu refused to keep the book in his house ever since reading R' Yehuda Fatiyah's criticisms of the book's author, and wrote that the Ben Ish Hai wrote his book "Lashon Hachamim" primarily to provide an alternative to Hemdat Yamim. Others, though, have claimed the Ben Ish Hai approved of Hemdat Yamim, bringing as evidence several instances where content from Hemdat Yamim appears in Ben Ish Hai.