feat: calendrier impérial et conversions calendaires

- calendrier impérial : fenêtre compacte (260px), affichage date
- commande /cal, auto-ouverture paramétrable dans les settings
- socket calendarSync : mise à jour temps réel pour les joueurs
- config MJ : année, jour (label live), heure:minute, planète
- boutons +1 jour et +1 heure (report 24h→jour, 365→1)
- conversions : Solomani, Vilani, Zhodani (Olympiade), Aslan, K'Kree, Hiver
- formules wiki.travellerrpg.com/Date_Conversion, section repliable
- fix: renderChatInput /cal trop large → exact match
- fix: fenêtre refermable (onClose nullifie la référence)
- fix: socket joueur lit data direct au lieu de readCalendar()
This commit is contained in:
2026-07-23 23:28:49 +02:00
parent 5a4d4c45dc
commit 00bcc775fe
9 changed files with 723 additions and 2 deletions
+39
View File
@@ -0,0 +1,39 @@
<form class="mgt2-cal-config">
<div class="mgt2-cal-config-row">
<label for="cal-year">Année</label>
<input type="number" id="cal-year" name="year" value="{{year}}" min="0" max="9999">
</div>
<div class="mgt2-cal-config-row">
<label for="cal-day">Jour</label>
<div class="mgt2-cal-day-group">
<input type="number" id="cal-day" name="day" value="{{day}}" min="1" max="365">
<span class="mgt2-cal-day-label">{{dayLabel}}</span>
</div>
</div>
<div class="mgt2-cal-config-row">
<label for="cal-hour">Heure</label>
<input type="number" id="cal-hour" name="hour" value="{{hour}}" min="0" max="23">
</div>
<div class="mgt2-cal-config-row">
<label for="cal-minute">Minute</label>
<input type="number" id="cal-minute" name="minute" value="{{minute}}" min="0" max="59">
</div>
<div class="mgt2-cal-config-row">
<label for="cal-planet">Planète</label>
<input type="text" id="cal-planet" name="planet" value="{{planet}}" placeholder="p. ex. Terra">
</div>
<div class="mgt2-cal-config-actions">
<button type="button" class="mgt2-cal-btn" data-action="day-inc"><i class="fas fa-plus"></i> +1 jour</button>
<button type="button" class="mgt2-cal-btn" data-action="hour-inc"><i class="fas fa-plus"></i> +1 heure</button>
<button type="button" class="mgt2-cal-btn mgt2-cal-btn-primary" data-action="apply">Appliquer</button>
</div>
<details class="mgt2-cal-conversions">
<summary>Conversions calendaires <span class="mgt2-cal-conv-note">(approximatif)</span></summary>
<div class="mgt2-cal-conv-row"><span class="mgt2-cal-conv-label">Solomani</span><span class="mgt2-cal-conv-val" data-cal="solomani">{{conversions.solomani}}</span></div>
<div class="mgt2-cal-conv-row"><span class="mgt2-cal-conv-label">Vilani</span><span class="mgt2-cal-conv-val" data-cal="vilani">{{conversions.vilani}}</span></div>
<div class="mgt2-cal-conv-row"><span class="mgt2-cal-conv-label">Zhodani</span><span class="mgt2-cal-conv-val" data-cal="zhodani">{{conversions.zhodani}}</span></div>
<div class="mgt2-cal-conv-row"><span class="mgt2-cal-conv-label">Aslan</span><span class="mgt2-cal-conv-val" data-cal="aslan">{{conversions.aslan}}</span></div>
<div class="mgt2-cal-conv-row"><span class="mgt2-cal-conv-label">K'Kree</span><span class="mgt2-cal-conv-val" data-cal="kkree">{{conversions.kkree}}</span></div>
<div class="mgt2-cal-conv-row"><span class="mgt2-cal-conv-label">Hiver</span><span class="mgt2-cal-conv-val" data-cal="hiver">{{conversions.hiver}}</span></div>
</details>
</form>