📜 [Script] Count Up Script & Count Down Script | Print many Days left | Lens Studio Count UP Script - (Prints How many days left from given Date eg. Day 360) // -----JS CODE----- //@input int startDateDay //@input int startDateMonth //@input int startDateYear // For 3D Text only change Component.Text to Component.Text3D //@input Component.Text countUpText // Component.Text works for Both "Text Object" & "Screen Text" startDateDay = script.startDateDay startDateMonth = script.startDateMonth startDateYear = script.startDateYear var startDate = new Date (startDateYear, startDateMonth - 1 , startDateDay); var today = new Date (); var timeDiff = Math .abs(today.getTime() - startDate.getTime()); var daysDiff = Math .ceil(timeDiff / ( 1000 * 3600 * 24 )); if (script.countUpText) { script.countUpText.text = "Day " + daysDiff; } Count Down Script - (Print What is the current day to give...
📜 [Script] Count Up Script & Count Down Script | Print many Days left | Lens Studio
Count UP Script - (Prints How many days left from given Date eg. Day 360)
// -----JS CODE----- //@input int startDateDay //@input int startDateMonth //@input int startDateYear // For 3D Text only change Component.Text to Component.Text3D //@input Component.Text countUpText // Component.Text works for Both "Text Object" & "Screen Text" startDateDay = script.startDateDay startDateMonth = script.startDateMonth startDateYear = script.startDateYear var startDate = new Date(startDateYear, startDateMonth - 1, startDateDay); var today = new Date(); var timeDiff = Math.abs(today.getTime() - startDate.getTime()); var daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)); if (script.countUpText) { script.countUpText.text = "Day " + daysDiff; }
Count Down Script - (Print What is the current day to given Date eg. Day 2)
// -----JS CODE----- //@input int endDateDay //@input int endDateMonth //@input int endDateYear // For 3D Text only change Component.Text to Component.Text3D //@input Component.Text countDownText // Component.Text works for Both "Text Object" & "Screen Text" endDateDay = script.endDateDay; endDateMonth = script.endDateMonth; endDateYear = script.endDateYear; var endDate = new Date(endDateYear, endDateMonth - 1, endDateDay); var today = new Date(); var timeDiff = Math.abs(endDate.getTime() - today.getTime()); var daysDiff = Math.floor(timeDiff / (1000 * 3600 * 24)) + 1; if (script.countDownText) { script.countDownText.text = "Day " + daysDiff; }
Comments
Post a Comment