Skip to content

Commit

Permalink
Merge pull request #12 from IPdotSetAF/other-calendars
Browse files Browse the repository at this point in the history
Other calendars
  • Loading branch information
IPdotSetAF authored May 16, 2024
2 parents b1f6b55 + 133bc67 commit 4d58102
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 14 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Click on each preview to watch live
</p>
<p>
<a href="https://ipdotsetaf.github.io/NeoMatrix/?preset=eyJjb250cm9sbGVycyI6e30sImZvbGRlcnMiOnsiUmFpbiI6eyJjb250cm9sbGVycyI6eyJNYXRyaXggU3BlZWQiOjI0LCJUcmFpbCBMZW5ndGgiOjAuODYsIkRyb3AgQ291bnQvQ29sdW1uIjoxLCJJbml0aWFsIEFuaW1hdGlvbiI6IjEifSwiZm9sZGVycyI6e319LCJDb2xvciI6eyJjb250cm9sbGVycyI6eyJDb2xvciBNb2RlIjoiMCIsIk1hdHJpeCBDb2xvciI6IiMwMGZmMDAiLCJDb2xvciBBbmltYXRpb24gU3BlZWQiOjAuNSwiSGlnaGxpZ2h0IEZpcnN0IENoYXJhY3RlciI6dHJ1ZX0sImZvbGRlcnMiOnt9fSwiQ2hhcmFjdGVycyI6eyJjb250cm9sbGVycyI6eyJDaGFyIHNldCI6IjMiLCJDdXN0b20gQ2hhciBTZXQiOiIwMTIzNDU2Nzg5QUJDREVGIn0sImZvbGRlcnMiOnt9fSwiRm9udCI6eyJjb250cm9sbGVycyI6eyJGb250IFNpemUiOjE1LCJGb250IjoiMyIsIkN1c3RvbSBGb250IjoibW9ub3NwYWNlIn0sImZvbGRlcnMiOnt9fSwiQXVkaW8gKG5vdCBhdmFpbGFibGUgaW4gd2ViIHZlcnNpb24pIjp7ImNvbnRyb2xsZXJzIjp7fSwiZm9sZGVycyI6e319LCJMb2dvIjp7ImNvbnRyb2xsZXJzIjp7IkxvZ28iOiI4IiwiQ3VzdG9tIExvZ28gVVJMIChTVkcvUE5HKSI6IiIsIlByZXNlcnZlIExvZ28gQ29sb3IiOnRydWUsIlNjYWxlIjowLjh9LCJmb2xkZXJzIjp7IlBvc2l0aW9uIjp7ImNvbnRyb2xsZXJzIjp7IlgiOjAsIlkiOi0xMjV9LCJmb2xkZXJzIjp7fX19fSwiQ2xvY2siOnsiY29udHJvbGxlcnMiOnsiQ2xvY2siOiIxIiwiMjQgSG91ciBmb3JtYXQiOnRydWUsIkRheS1saWdodCBTYXZpbmciOjAsIlNjYWxlIjoyfSwiZm9sZGVycyI6eyJQb3NpdGlvbiI6eyJjb250cm9sbGVycyI6eyJYIjowLCJZIjoxNH0sImZvbGRlcnMiOnt9fX19LCJNZXNzYWdlIjp7ImNvbnRyb2xsZXJzIjp7Ik1lc3NhZ2UiOmZhbHNlLCJNZXNzYWdlIFRleHQiOiJUSEUgTUFUUklYIiwiU2NhbGUiOjF9LCJmb2xkZXJzIjp7IlBvc2l0aW9uIjp7ImNvbnRyb2xsZXJzIjp7IlgiOjAsIlkiOjB9LCJmb2xkZXJzIjp7fX19fSwiT3RoZXIiOnsiY29udHJvbGxlcnMiOnsiQ29kZXMgKENvbW1hIHNlcGFyYXRlZCkiOiJUSEUgTUFUUklYLElQLkFGIn0sImZvbGRlcnMiOnt9fX19"><img src="images/preview4.gif" width=270px height=270px/></a>
<a href="https://ipdotsetaf.github.io/NeoMatrix/?preset=eyJjb250cm9sbGVycyI6e30sImZvbGRlcnMiOnsiUmFpbiI6eyJjb250cm9sbGVycyI6eyJNYXRyaXggU3BlZWQiOjI0LCJUcmFpbCBMZW5ndGgiOjAuODIsIkRyb3AgQ291bnQvQ29sdW1uIjoxLCJJbml0aWFsIEFuaW1hdGlvbiI6IjEifSwiZm9sZGVycyI6e319LCJDb2xvciI6eyJjb250cm9sbGVycyI6eyJDb2xvciBNb2RlIjoiMyIsIk1hdHJpeCBDb2xvciI6IiMwMGZmMDAiLCJDb2xvciBBbmltYXRpb24gU3BlZWQiOjAuMTQsIkhpZ2hsaWdodCBG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QVBTIjpmYWxzZSwiRGVsaW1pdGVyIjoiNCIsIlZlcnRpY2FsIE9yaWVudGF0aW9uIjpmYWxzZSwiU2NhbGUiOjB9LCJmb2xkZXJzIjp7IlBvc2l0aW9uIjp7ImNvbnRyb2xsZXJzIjp7IlgiOjAsIlkiOjJ9LCJmb2xkZXJzIjp7fX19fSwiTWVzc2FnZSI6eyJjb250cm9sbGVycyI6eyJNZXNzYWdlIjp0cnVlLCJNZXNzYWdlIFRleHQiOiJJUC5BRiBQcmVzZW50c1xcbiAgTkVPIE1BVFJJWCIsIlNjYWxlIjowfSwiZm9sZGVycyI6eyJQb3NpdGlvbiI6eyJjb250cm9sbGVycyI6eyJYIjowLCJZIjotMX0sImZvbGRlcnMiOnt9fX19LCJPdGhlciI6eyJjb250cm9sbGVycyI6eyJDb2RlcyAoQ29tbWEgc2VwYXJhdGVkKSI6IiJ9LCJmb2xkZXJzIjp7fX19fQ%3D%3D"><img src="images/preview6.gif" width=270px height=270px/></a>
<a href="https://ipdotsetaf.github.io/NeoMatrix/?preset=eyJjb250cm9sbGVycyI6e30sImZvbGRlcnMiOnsiUmFpbiI6eyJjb250cm9sbGVycyI6eyJNYXRyaXggU3BlZWQiOjI0LCJUcmFpbCBMZW5ndGgiOjAuODIsIkRyb3AgQ291bnQvQ29sdW1uIjoxLCJJbml0aWFsIEFuaW1hdGlvbiI6IjEifSwiZm9sZGVycyI6e319LCJDb2xvciI6eyJjb250cm9sbGVycyI6eyJDb2xvciBNb2RlIjoiMyIsIk1hdHJpeCBDb2xvciI6IiMwMGZmMDAiLCJDb2xvciBBbmltYXRpb24gU3BlZWQiOjAuMTQsIkhpZ2hsaWdodCBGaXJzdCBDaGFyYWN0ZXIiOmZhbHNlfSwiZm9sZGVycyI6e319LCJDaGFyYWN0ZXJzIjp7ImNvbnRyb2xsZXJzIjp7IkNoYXIgc2V0IjoiMyIsIkN1c3RvbSBDaGFyIFNldCI6IjAxMjM0NTY3ODlBQkNERUYifSwiZm9sZGVycy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sZSI6MH0sImZvbGRlcnMiOnsiUG9zaXRpb24iOnsiY29udHJvbGxlcnMiOnsiWCI6LTIsIlkiOjI1fSwiZm9sZGVycyI6e319fX0sIk1lc3NhZ2UiOnsiY29udHJvbGxlcnMiOnsiTWVzc2FnZSI6dHJ1ZSwiTWVzc2FnZSBUZXh0IjoiSVxcblBcXG5BXFxuRiIsIlNjYWxlIjoyfSwiZm9sZGVycyI6eyJQb3NpdGlvbiI6eyJjb250cm9sbGVycyI6eyJYIjoyMiwiWSI6MH0sImZvbGRlcnMiOnt9fX19LCJPdGhlciI6eyJjb250cm9sbGVycyI6eyJDb2RlcyAoQ29tbWEgc2VwYXJhdGVkKSI6IklQLkFGLFRIRSBNQVRSSVgifSwiZm9sZGVycyI6e319fX0%3D"><img src="images/preview5.gif" width=270px height=270px/></a>
<a href="https://ipdotsetaf.github.io/NeoMatrix/?preset=eyJjb250cm9sbGVycyI6e30sImZvbGRlcnMiOnsiUmFpbiI6eyJjb250cm9sbGVycyI6eyJNYXRyaXggU3BlZWQiOjIwLCJUcmFpbCBMZW5ndGgiOjAuNzUsIkRyb3AgQ291bnQvQ29sdW1uIjoyLCJJbml0aWFsIEFuaW1hdGlvbiI6IjIifSwiZm9sZGVycyI6e319LCJDb2xvciI6eyJjb250cm9sbGVycyI6eyJDb2xvciBNb2RlIjoiMyIsIk1hdHJpeCBDb2xvciI6IiMwMGZmMDAiLCJDb2xvciBBbmltYXRpb24gU3BlZWQiOjAuMTIsIkhpZ2hsaWdodCBGaXJzdCBDaGFyYWN0ZXIiOmZhbHNlfSwiZm9sZGVycyI6e319LCJDaGFyYWN0ZXJzIjp7ImNvbnRyb2xsZXJzIjp7IkNoYXIgc2V0IjoiMyIsIkN1c3RvbSBDaGFyIFNldCI6IjAxMjM0NTY3ODlBQkNERUYifSwiZm9sZGVycyI6e319LCJGb250Ijp7ImNvbnRyb2xsZXJzIjp7IkZvbnQgU2l6ZSI6MTQsIkZvbnQiOiIzIiwiQ3VzdG9tIEZ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YWdlIjp7ImNvbnRyb2xsZXJzIjp7Ik1lc3NhZ2UiOnRydWUsIk1lc3NhZ2UgVGV4dCI6IklQLkFGIFByZXNlbnRzXFxuICBORU8gTUFUUklYIiwiU2NhbGUiOjB9LCJmb2xkZXJzIjp7IlBvc2l0aW9uIjp7ImNvbnRyb2xsZXJzIjp7IlgiOjAsIlkiOi0xfSwiZm9sZGVycyI6e319fX0sIk90aGVyIjp7ImNvbnRyb2xsZXJzIjp7IkNvZGVzIChDb21tYSBzZXBhcmF0ZWQpIjoiIn0sImZvbGRlcnMiOnt9fX19"><img src="images/preview6.gif" width=270px height=270px/></a>
</p>

##
Expand Down Expand Up @@ -121,6 +121,10 @@ Click on each preview to watch live
- Scale
- Position
- Date
- Date
- Gregorian
- Persian
- Hijri
- Year
- Full
- Short
Expand Down
46 changes: 36 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ window.onload = function () {
ui_day_scale: 1,
ui_day_positionX: 0,
ui_day_positionY: 0,
ui_date_date: false,
ui_date_date: "0",
ui_date_orientation: false,
ui_date_year: "2",
ui_date_order: "0",
Expand Down Expand Up @@ -189,7 +189,10 @@ window.onload = function () {
dayFolder.close();

const dateFolder = gui.addFolder("Date");
dateFolder.add(options, "ui_date_date").name("Date").onChange(updateMask);
dateFolder.add(options, "ui_date_date", optionsToDict(config.general.properties.ui_date_date.options)).name("Date").onChange(() => {
updateTime();
updateMask();
});
dateFolder.add(options, "ui_date_year", optionsToDict(config.general.properties.ui_date_year.options)).name("Year").onChange(updateMask);
dateFolder.add(options, "ui_date_order", optionsToDict(config.general.properties.ui_date_order.options)).name("Order").onChange(updateMask);
dateFolder.add(options, "ui_date_monthName").name("Month Name").onChange(updateMask);
Expand Down Expand Up @@ -335,8 +338,10 @@ window.onload = function () {
properties.ui_day_scale || properties.ui_day_positionx || properties.ui_day_positiony)
updateMask();

if (properties.ui_date_date)
if (properties.ui_date_date) {
options.ui_date_date = properties.ui_date_date.value;
updateTime();
}
if (properties.ui_date_orientation)
options.ui_date_orientation = properties.ui_date_orientation.value;
if (properties.ui_date_year)
Expand Down Expand Up @@ -391,8 +396,11 @@ window.onload = function () {
}, false);

//MARK: Variables
let months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
dateDelimiters = ["", " ", "-", ".", "/"];
let months = [
["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
["Farvardin", "Ordibehesht", "Khordad", "Tir", "Mordad", "Shahrivar", "Mehr", "Aban", "Azar", "Dey", "Bahman", "Esfand"],
["Muharram", "Safar", "Rabi' al-Awwal", "Rabi' al-Thani", "Jumada al-Awwal", "Jumada al-Thani", "Rajab", "Sha'ban", "Ramadan", "Shawwal", "Dhu al-Qadah", "Dhu al-Hijjah"]
], dateDelimiters = ["", " ", "-", ".", "/"];
let days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
let fonts = ["monospace", "consolas", "courier-bold", "neo-matrix"];
let charsets = [
Expand Down Expand Up @@ -464,9 +472,27 @@ window.onload = function () {
function updateTime() {
var today = new Date();
today.setHours(today.getHours() + options.ui_clock_dayLightSaving);
year = today.getFullYear();
month = today.getMonth();
date = today.getDate();

switch (options.ui_date_date) {
case "1":
year = today.getFullYear();
month = today.getMonth() + 1;
date = today.getDate();
break;
case "2":
var parts = today.toLocaleDateString('fa-IR-u-nu-latn').split("/");
year = parseInt(parts[0]);
month = parseInt(parts[1]);
date = parseInt(parts[2]);
break;
case "3":
var parts = today.toLocaleDateString('ar-SA-u-nu-latn').split("/");
year = parseInt(parts[2]);
month = parseInt(parts[1]);
date = parseInt(parts[0]);
break;
}

day = today.getDay();
hour = today.getHours();
minute = today.getMinutes();
Expand Down Expand Up @@ -543,12 +569,12 @@ window.onload = function () {
}
}

if (options.ui_date_date) {
if (options.ui_date_date != "0") {
var dateText = date.toString(), monthText, yearText = "", completeDate;
if (dateText.length < 2)
dateText = "0" + dateText;
if (options.ui_date_monthName) {
monthText = months[month];
monthText = months[parseInt(options.ui_date_date) - 1][month - 1];
if (options.ui_date_allCaps)
monthText = monthText.toUpperCase();
} else {
Expand Down
23 changes: 21 additions & 2 deletions project.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,29 @@
"ui_date_date" :
{
"index" : 44,
"options" :
[
{
"label" : "None",
"value" : "0"
},
{
"label" : "Gregorian",
"value" : "1"
},
{
"label" : "Persian",
"value" : "2"
},
{
"label" : "Hijri",
"value" : "3"
}
],
"order" : 144,
"text" : "Date",
"type" : "bool",
"value" : false
"type" : "combo",
"value" : "0"
},
"ui_date_year" :
{
Expand Down

0 comments on commit 4d58102

Please sign in to comment.