All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
The book "Fadhaa'il Al-A'maal" compiled by Shaykh Muhammad Zakariyya Al-Kandahlawi, is not trustworthy as far as the matters of creed are concerned. That is because it contains issues that contradict the creed of Ahlus-Sunnah Wal-Jamaa'ah (those who adhere to the Sunnah) and provided evidence of fabricated narrations. For instance, he says that it is permissible to supplicate Allaah by the virtue of the Prophet . He provided the following fabricated narration as evidence: "When Aadam, may exalt his mention, committed the sin, he said: "O Allaah! I ask you by virtue of Muhammad ,…" The scholars consider this narration as fabricated, among whom are Ath-Thahabi, Al-Albaani and others. One of the narrators of this narration is Abdur-Rahmaan Ibn Zayd Ibn Aslam, who is considered as a weak narrator (i.e. his narrations are not accepted nor are they reliable) according to the agreement of all the scholars among whom are Imaam Maalik, Ahmad, Ibn Ma'een, Ibn Al-Madeeni and others. Moreover, Imaam Ibn Al-Jawzi said that all the scholars agreed in a consensus that this narrator is weak.
In short, it is not advisable to read that book.
The story you have mentioned about of the Shaykh who informed the people of his death eight days before it actually happened, is one such example of how this book contradicts the clear texts of the Qur'an.
If the Shaykh had stated the time of his death in a definitive way, then this is claiming to know the unseen while Allaah says (which means): {And no soul perceives what it will earn tomorrow, and no soul perceives in what land it will die.}[31:34] 'Aa'ishah said: "Whoever claims to know the unseen is a liar."
However, if he had informed about his death just as a presumption based on a dream or the like, then this could happen and does not contradict the fact that it is only Allaah who knows the unseen.
Saying that Allaah informs pious people about the unseen, is answered by the saying of Allaah (which means): {He Alone is the All-Knower of the unseen and he does not disclose His [knowledge of the] unseen to anyone except whom He has approved of messengers,}[72:26-27].
So Allaah does not reveal the unseen to anyone except to a Messenger to whom He informs as much as He likes of it [unseen]. This is because Allaah supports them with miracles, among which is informing them of the unseen. Persons other than Prophets could not know the unseen at all but they may predict what will happen through a dream or by insight and the like.
The author of "At-Tahreer and At-Tanweer" said regarding the interpretation of the above verse: 'Disclosing the knowledge of the unseen to the Prophets' means unveiling the unseen resulting in them having definitive knowledge of it as the knowledge of something when one sees it. The verse does not mean feeling comfortable about certain matters that some pious people might have after seeing a dream, or by insight, etc. The Prophet said: "Among the nations before you, there were people who had insight and inspiration, and if there would be any such persons amongst my followers, then 'Umar will be one of them." [Muslim]
Allaah knows best.