temper.std.temporal.TemporalGlobal Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of temper-std Show documentation
Show all versions of temper-std Show documentation
Optional support library provided with Temper
package temper.std.temporal;
import temper.core.Core.CodePointStringSlice;
import temper.core.Core;
import java.util.List;
public final class TemporalGlobal {
private TemporalGlobal() {
}
static final List daysInMonth__21;
static boolean isLeapYear__19(int year__22) {
boolean return__13;
int t_132;
if (year__22 % 4 == 0) {
if (year__22 % 100 != 0) {
return__13 = true;
} else {
t_132 = year__22 % 400;
return__13 = t_132 == 0;
}
} else {
return__13 = false;
}
return return__13;
}
static String pad__20(String padding__24, int num__25) {
String return__14;
CodePointStringSlice t_185;
String decimal__27 = Integer.toString(num__25, 10);
CodePointStringSlice t_181 = Core.stringCodePoints(decimal__27);
CodePointStringSlice decimalCodePoints__28 = t_181;
String sign__29;
if (decimalCodePoints__28.read() == 45) {
sign__29 = "-";
t_185 = decimalCodePoints__28.advance(1);
decimalCodePoints__28 = t_185;
} else {
sign__29 = "";
}
CodePointStringSlice paddingCp__30 = Core.stringCodePoints(padding__24);
int nNeeded__31 = paddingCp__30.length() - decimalCodePoints__28.length();
if (nNeeded__31 <= 0) {
return__14 = decimal__27;
} else {
String pad__32 = paddingCp__30.limit(nNeeded__31).toString();
String decimalOnly__33 = decimalCodePoints__28.toString();
return__14 = sign__29 + pad__32 + decimalOnly__33;
}
return return__14;
}
static {
daysInMonth__21 = List.of(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy