SecondTempleTimerLibrary
The SecondTempleTimer library offers a robust set of methods to calculate and retrieve various time intervals since the destruction of the Second Temple. Below is a detailed overview of the key classes, interfaces, and methods available.
Install / Use
/learn @kdroidFilter/SecondTempleTimerLibraryREADME
SecondTempleTimer - Multiplatform Native Library
The SecondTempleTimer is a multiplatform library, generated using Kotlin, that can be compiled into native libraries for various platforms.
It calculates the elapsed time since the destruction of the Second Temple, providing real-time updates in years, months, days, hours, minutes, and seconds.
This library is designed to be versatile and can be integrated across different environments, including JavaScript, desktop, and mobile applications.
Acknowledgements
This project is based on the excellent KosherKotlin project, which provides a foundation for handling Jewish date calculations and other related functionalities.
Getting Started
Build platform artifacts
Android aar
- Run
./gradlew :SecondTempleTimer:assembleRelease - Output:
/SecondTempleTimer/build/outputs/aar/SecondTempleTimer-release.aar
JVM jar
- Run
./gradlew :SecondTempleTimer:jvmJar - Output:
/SecondTempleTimer/build/libs/SecondTempleTimer-jvm-1.0.jar
iOS Framework
- Run
./gradlew :SecondTempleTimer:linkReleaseFrameworkIosArm64 - Output:
/SecondTempleTimer/build/bin/iosArm64/releaseFramework/SecondTempleTimer.framework
JS file
- Run
./gradlew :SecondTempleTimer:jsBrowserProductionWebpack - Output:
/SecondTempleTimer//build/kotlin-webpack/js/productionExecutable/SecondTempleTimer.js
macOS Framework
- Run
./gradlew :SecondTempleTimer:linkReleaseFrameworkMacosArm64 - Output:
/SecondTempleTimer/build/bin/macosArm64/releaseFramework/SecondTempleTimer.framework
Linux static library
- Run
./gradlew :SecondTempleTimer:linkReleaseStaticLinuxX64 - Output:
/SecondTempleTimer/build/bin/linuxX64/releaseStatic/libSecondTempleTimer.a
Windows static library
- Run
./gradlew :SecondTempleTimer:linkReleaseStaticMingwX64 - Output:
/SecondTempleTimer/build/bin/mingwX64/releaseStatic/libSecondTempleTimer.a
Wasm binary file
- Run
./gradlew :SecondTempleTimer:wasmJsBrowserDistribution - Output:
/SecondTempleTimer/build/dist/wasmJs/productionExecutable/SecondTempleTimer-wasm-js.wasm
Example Usage in Kotlin (For Javascript Usage, see Below)
val provider = TimeIntervalProviderImpl()
// Get the total number of days since the destruction
val totalDays = provider.calculateDaysSinceTempleDestruction()
// Get the detailed time interval since the destruction
val timeInterval = provider.calculateTimeIntervalSinceTempleDestruction()
println("Total days: ${timeInterval.totalNumberOfDays}")
println("Years: ${timeInterval.years}, Months: ${timeInterval.months}, Days: ${timeInterval.days}")
println("Hours: ${timeInterval.hours}, Minutes: ${timeInterval.minutes}, Seconds: ${timeInterval.seconds}")
Javascript Html Installation
To use the SecondTempleTimer library in your Javascript project, follow these steps:
- Generate the library: Execute the following command in the root of the project:
- Run
./gradlew :SecondTempleTimer:jsBrowserProductionWebpack
- Locate the output: :
- Output:
/SecondTempleTimer//build/kotlin-webpack/js/productionExecutable/SecondTempleTimer.js
- Include the library in your HTML file:: :
<script type="text/javascript" src="path/to/SecondTempleTimer.js"></script>'
- Api Reference (JS Only)
The Provider class exposes several methods to retrieve different components of the time interval:
- getTotalDays(): Returns the total number of days since the destruction of the Second Temple.
- getActualYears(): Returns the number of years since the destruction.
- getActualMonths(): Returns the number of months since the last complete year.
- getActualDays(): Returns the number of days since the last complete month.
- getActualHours(): Returns the number of hours since the last complete day.
- getActualMinutes(): Returns the number of minutes since the last complete hour.
- getActualSeconds(): Returns the number of seconds since the last complete minute.
- Exemple Usage
<script type="text/javascript" src="https://github.com/kdroidFilter/SecondTempleTimerLibrary/releases/download/0.1/SecondTempleTimer.js"></script>
<script>
function updateTimer() {
var provider = new SecondTempleTimer.Provider();
document.getElementById('totaldays').textContent = provider.getTotalDays();
document.getElementById('years').textContent = provider.getActualYears();
document.getElementById('months').textContent = provider.getActualMonths();
document.getElementById('days').textContent = provider.getActualDays();
document.getElementById('hours').textContent = provider.getActualHours();
document.getElementById('minutes').textContent = provider.getActualMinutes();
document.getElementById('seconds').textContent = provider.getActualSeconds();
}
// Update the timer every second
setInterval(updateTimer, 1000);
// Initial update
updateTimer();
</script>
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
