![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
代码片段
程序员小朋
这个作者很懒,什么都没留下…
展开
-
java获取指定两个日期的相差月数
/** * 获取指定两个日期的相差月 */ private int diffMonthByCalendar(Calendar startCalendar, Calendar endCalendar) { // 时间比较,保证endCalendar为较大的日期 if (startCalendar.after(endCalendar)) { Calendar temp = startCalendar; startCalendar = endCalendar; endCal..原创 2021-08-18 17:39:39 · 269 阅读 · 0 评论 -
微信小程序摇一摇
方法定义: let shakeInfo = { openFlag: false,// 是否开启摇一摇,*****注意:如果是小程序全局监听摇一摇,这里默认为true shakeSpeed: 110,//设置阈值,越小越灵敏 shakeStep: 2000,//摇一摇成功后间隔 lastTime: 0,//此变量用来记录上次摇动的时间 x: 0, ...原创 2019-11-21 10:34:39 · 1060 阅读 · 0 评论 -
Google Guava
CollectionUtils.isNotEmpty(list);// 判断List是否为null或空 MapUtils.isNotEmpty(map);// 判断Map是否为null或空 // 实体list 转换成 实体中某个属性的list List<Long> skuIds = Lists.transform(shopDeviceList, new Function...原创 2018-05-28 16:07:57 · 185 阅读 · 0 评论 -
java获取指定月份的工作日(只去除周六日,没有去除节假日)
private static int getWorkDays(int theYear, int theMonth) { // 计算指定月有多少工作日 int workDays = 0; Calendar cal = Calendar.getInstance(); cal.set(theYear, theMonth - 1, 1);// 从每月1号开始 int days = ...原创 2019-08-16 16:20:52 · 1566 阅读 · 0 评论