๋ ธ์ D-day ๋ง๋ค๊ธฐ
๐ TL;DR
๋ ธ์ ์ธ๋ผ์ธ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์์์ ํ์ฉํ๋ฉด ์๋์ผ๋ก D-day ๊ณ์ฐ์ ํ ์ ์๋ค.
๐๏ธ
๋ ธ์ D-day ๋ง๋ค๊ธฐ
-
1.
์ํ๋ ์์ญ์์ "/์ธ๋ผ์ธ"์ ์ ๋ ฅํ ํ "๋ฐ์ดํฐ๋ฒ ์ด์ค - ์ธ๋ผ์ธ"์ ์ ํํ๋ค.
-
2.
๊ธฐ๋ณธ์ ์ผ๋ก ์์ฑ๋๋ "ํ๊ทธ" ์์ฑ์ ๋ง์ฐ์ค ์ฐ์ธก ํค๋ฅผ ๋๋ฌ "์์ฑ ์ญ์ "๋ฅผ ๋๋ฌ ์ ๊ฑฐํ๋ค.
-
3.
"+" ๋ฒํผ์ ๋๋ฌ "๋ ์ง" ์ ํ์ ์์ฑ์ ์์ฑ,
์์ฑ ์ด๋ฆ์ ๊ธฐ๋ณธ๊ฐ์ธ "๋ ์ง"๋ก ์ค์ ํ๋ค.
-
4.
์ถ๊ฐ๋ก "+" ๋ฒํผ์ ๋๋ฌ "์์" ์ ํ์ ์์ฑ์ ์์ฑ,
์์ฑ ์ด๋ฆ์ "D-day"๋ก ์ค์ ํ๋ค.
-
5.
์์ฑ๋ "D-day" ์์ฑ์์ ๋น์ด์๋ ๊ฐ์ ํด๋ฆญํ ํ,
์๋์์ ์ํ๋ ์์์ ์ฐพ์ ์ ๋ ฅํ๋ค.
1. ๋จ์ ์ผ์ ๋ง ํ๊ธฐ
if(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") >= 0, if(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") == 0, "๐ฏ D-day", ("-" + format(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days"))) + "์ผ" ), "" )
2. ์ง๋๊ฐ ์ผ์ ๋ชจ๋ ๋์ผํ๊ฒ ํ๊ธฐ
if(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") > 0, ("-" + format(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days"))) + "์ผ", if(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") == 0, "๐ฏ D-day", "๐" ) )
3. ๋ชจ๋ ์ผ์ ํ๊ธฐ
if(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") == 0, "๐ฏ D-day", if(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") < 0, ("+" + format(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") * -1)), ("-" + format(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days"))) ) ) + if(dateBetween(prop("๋ ์ง"), dateSubtract(dateSubtract(now(), hour(now()), "hours"), minute(now()), "minutes"), "days") == 0, "", "์ผ" )