|
|
|
@ -1,5 +1,9 @@
|
|
|
|
|
package test;
|
|
|
|
|
|
|
|
|
|
import weaver.common.DateUtil;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author weaver_cl
|
|
|
|
|
* @Description:
|
|
|
|
@ -9,13 +13,12 @@ package test;
|
|
|
|
|
public class MainTest {
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
double punchInHours = 11.87; // 打卡工时时长为 11.87
|
|
|
|
|
double actualWorkHours = calculateActualWorkHours(punchInHours);
|
|
|
|
|
System.out.println("实际工时时长为:" + actualWorkHours + "小时");
|
|
|
|
|
|
|
|
|
|
double punchInHours2 = 3.57; // 打卡工时时长为 3.5
|
|
|
|
|
double actualWorkHours2 = calculateActualWorkHours(punchInHours2);
|
|
|
|
|
System.out.println("实际工时时长为:" + actualWorkHours2 + "小时");
|
|
|
|
|
LocalDate localDate = LocalDate.parse("2029-02"+"-01");
|
|
|
|
|
String fromDate = localDate.toString();
|
|
|
|
|
String toDate = localDate.withDayOfMonth(localDate.lengthOfMonth()).toString();
|
|
|
|
|
System.out.println(fromDate);
|
|
|
|
|
System.out.println(toDate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static double calculateActualWorkHours(double punchInHours) {
|
|
|
|
|