SDK 1.2 / 1.3 How to determine sunset / sunrise in whatchface?

Hello

I stopped development more than a year ago...But now I restarted to create a new own whatchface for my F3.

Has anyone published a nice function for determination of local sunset and sunrise in whatchfaces?
I couldn't find anything which comes close to "best practice" in the forums :(

Thanks in advance