Preview
Using the sleep calculator, you can easily tell it when you want to wake up and it will show you a variety of times to fall asleep and how many sleep cycles you will achieve. Keep scrolling for our wake calculator!
What's New
Version 1.0
First release
What it does
12 actions-
CommentAuthor: Ari R. Abdulla - Using the sleep calculator, you can easily tell it when you want to wake up and it will show you a variety of times to fall asleep and how many sleep cycles you will achieve. Keep scrolling for our wake calculator! - Powered…
-
Ask for InputI want to wake up at...
-
Adjust Date
-
Format Date
-
Adjust Date
-
Format Date
-
Adjust Date
-
Format Date
-
Adjust Date
-
Format Date
-
Text
-
Show Result
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#include 'actions/calendar'
#define color darkblue
#define glyph moon
/*
Author: Ari R. Abdulla
- Using the sleep calculator, you can easily tell it when you want to wake up and it will show you a variety of times to fall asleep and how many sleep cycles you will achieve. Keep scrolling for our wake calculator!
- Powered By:
https://sleepopolis.com/calculators/sleep/
*/
prompt("I want to wake up at...", "Time")
const NineHoursOfSleep = adjustDate(, "Subtract")
const SixCycles = formatDate(NineHoursOfSleep, "None")
const SevenAndAHalfHoursOfSleep = adjustDate(, "Subtract")
const FiveCycles = formatDate(SevenAndAHalfHoursOfSleep, "None")
const SixHoursOfSleep = adjustDate(, "Subtract")
const FourCycles = formatDate(SixHoursOfSleep, "None")
const FourAndAHalfHoursOfSleep = adjustDate(, "Subtract")
const ThreeCycles = formatDate(FourAndAHalfHoursOfSleep, "None")
const Result = "You should try to fall asleep at one of the following times:\n\n1️⃣ {SixCycles} For Six Cycles\n- Nine Hours of Sleep.\n2️⃣ {FiveCycles} For Five Cycles\n- Seven and a half Hours of Sleep.\n3️⃣ {FourCycles} For Four Cycles\n- Six Hours of Sleep.\n4️⃣ {ThreeCycles} For Three Cycles\n- Four and a half Hours of Sleep.\n\nPlease keep in mind that you should be falling asleep at these times. The average human takes fourteen minutes to fall asleep, so plan accordingly!"
show(Result)
Open in Cherri Playground
Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.
Ratings & Reviews
Write a Review–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings
No reviews yet. Be the first to share what you think!
Advertisement
More by arirafiq
You Might Also Like
Advertisement