First pass at systime app

This commit is contained in:
Madison Rye Progress
2025-10-05 17:31:48 -07:00
parent ab8681cb58
commit 66d6f9d216
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,10 @@
---
title: Systime Date Converter
---
<div id="converter">
<input type="text" class="systime">
<input type="datetime-local" class="date">
</div>
<script src="convert.js"></script>

View File

@ -0,0 +1,21 @@
class Systime {
year: number;
dayOfYear: number;
hundredths: number;
constructor(date: Date) {
this.fromDate(date);
}
fromDate(date: Date): void {
}
toDate(): Date {
}
fromString(str: string): void {
}
toString(): string {
}
};

35
content/extras/systime.md Normal file
View File

@ -0,0 +1,35 @@
---
title: Systime
---
You can use this form to convert to/from [systime](https://wiki.post-self.ink/wiki/Systime).
<div style="text-align: center;">
<input type="text" id="systime" value="systime 1+21" /><br>
<input type="button" id="convert" value="Convert systime..." />
</div>
<div id="output" />
<script type="text/javascript">
document.getElementById('convert').addEventListener("click", (ev) => {
fetch(`https://systime.post-self.ink/api/1/systime/${document.getElementById('systime').value}`)
.then((response) => {
if (!response.ok) {
document.getElementById('output').innerHTML = `Error converting systime`;
throw new Error(response.status);
}
return response.json();
})
.then((json) => {
document.getElementById('output').innerHTML = `
<dl>
<dt>Systime</dt>
<dd>${json.systime.string}</dd>
<dt>Gregorian</dt>
<dd>${json.gregorian.string}</dd>
<dt>Hebrew</dt>
<dd>${json.hebrew.string}</dd>
</dl>`;
});
});
</script>