当前位置:网站首页>Use js to obtain the last quarter based on the current quarter
Use js to obtain the last quarter based on the current quarter
2022-06-26 00:11:00 【Daily log of the great demon king】
var today= myDate.toLocaleDateString();// Get current date
var strYear = myDate.getFullYear();
var strMonth = myDate.getMonth() + 1;
var strQuarter = Math.floor((strMonth % 3 == 0 ? (strMonth / 3) : (strMonth / 3 + 1)));
strYear=((strQuarter==1)?(strYear-1):(strYear));
strQuarter=((strQuarter==1)?(4):(strQuarter-1));
Be careful : When the date is 01-01---03-31 Yes, in the first quarter , We need to put the year -1 That is, the fourth quarter of the previous year
incidentally : I wrote a get current date .
( You can refer to the judgment based on the current date to obtain the last quarter )
Here I write such a method , Another way is for the great God to discuss and share
边栏推荐
- 10.4.1、數據中臺
- smt贴片加工行业pcba常见测试方法优劣分析比较
- ffmpeg 版本切换
- (Reprint) visual explanation of processes and threads
- Bit compressor [Blue Bridge Cup training]
- Common knowledge points in JS
- SMT贴片加工pcba立碑现象的原因和解决方法
- 7. common instructions (Part 2): common operations of v-on, v-bind and V-model
- Reading notes on how to connect the network - hubs, routers and routers (III)
- About Simple Data Visualization
猜你喜欢
快手实时数仓保障体系研发实践
Installation of third-party library iGraph for social network visualization
Bit compressor [Blue Bridge Cup training]
10.2.3、Kylin_kylin的使用,维度必选
Circuit de fabrication manuelle d'un port série de niveau USB à TTL pour PL - 2303hx Old bear passing Sina blog
【微信公众号H5】 生成带参数进入公众号关注页的二维码 监听用户关注公众号事件 自定义菜单栏 (服务端)
10.4.1 data console
Recherche documentaire (3): examen des modèles de prévision de la consommation d'énergie des bâtiments fondés sur les données
Simulation connection between WinCC and STEP7_ Old bear passing by_ Sina blog
Common problems encountered when creating and publishing packages using NPM
随机推荐
redis之集群
【ROS进阶篇】第一讲 常用API介绍
如何绕过SSL验证
Some common operation methods of array
Sword finger offer 48 Longest substring without duplicate characters
Hand made pl-2303hx USB to TTL level serial port circuit_ Old bear passing by_ Sina blog
Topic36——53. 最大子数组和
Shredding Company poj 1416
Several common rich text editors
On the use of bisection and double pointer
SPI锡膏检查机的作用及原理
14.1.1 promethues monitoring, four data types metrics, pushgateway
关于二分和双指针的使用
详解synchronize关键字
Joint simulation of STEP7 and WinCC_ Old bear passing by_ Sina blog
Mysql5.7.31自定义安装详细说明
Darkent2ncnn error
【微信公众号H5】 生成带参数进入公众号关注页的二维码 监听用户关注公众号事件 自定义菜单栏 (服务端)
farsync 简易测试
手工制作 pl-2303hx 的USB轉TTL電平串口的電路_過路老熊_新浪博客