ShareShortcuts

SleepCycle Calculator

arirafiq
Fork “SleepCycle Calculator”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so arirafiq gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
39K
Saved
0
Actions
12
Category
Calculations
Version
1.0
Language
EN

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

Version History
1.0 Sep 5, 2022

First release

What it does

12 actions
  1. Comment
    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…
  2. Ask for Input
    I want to wake up at...
  3. Adjust Date
  4. Format Date
  5. Adjust Date
  6. Format Date
  7. Adjust Date
  8. Format Date
  9. Adjust Date
  10. Format Date
  11. Text
  12. Show Result

View as code
Beta

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

See All

You Might Also Like

See All
Advertisement