惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
T
Threatpost
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs
S
Securelist
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
S
Secure Thoughts
MyScale Blog
MyScale Blog
O
OpenAI News
P
Palo Alto Networks Blog
美团技术团队
C
Cyber Attacks, Cyber Crime and Cyber Security
TaoSecurity Blog
TaoSecurity Blog
量子位
L
Lohrmann on Cybersecurity
G
GRAHAM CLULEY
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
Know Your Adversary
Know Your Adversary
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Simon Willison's Weblog
Simon Willison's Weblog
宝玉的分享
宝玉的分享
PCI Perspectives
PCI Perspectives
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
I
InfoQ
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
S
Security @ Cisco Blogs
S
Schneier on Security
B
Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Cloudflare Blog
AWS News Blog
AWS News Blog
IT之家
IT之家
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
H
Heimdal Security Blog
I
Intezer
A
Arctic Wolf
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
W
WeLiveSecurity

博客园 - 五蕴非空

AI工具实践日记(二):在 OpenClaw 中调用 OpenCode 进行开发任务 AI工具实践日记(一):在树莓派上搭建OpenClaw,一个后端开发者的真实踩坑记录 .net core XML 解析帮助类 常用工具类 .net Core 同一接口不同实现的依赖注入 - 五蕴非空 大批量数据操作的性能优化方案 .net core 3.1 配置文件立即更新 为.net Core 3.0 WebApi 创建Linux守护进程 asp.net core 3.0 JObject The collection type 'Newtonsoft.Json.Linq.JObject' is not supported .net Core2.2 WebApi通过OAuth2.0实现微信登录 Asp.net导出Excel文件 Ext.Net 使用总结之GridPanel中的选中行 Ext.Net 使用总结之查询条件中的起始日期 Ext.Net 使用总结之GridPanel的删除事件 使用 NuGet 管理项目库 JavaScript 获取客户端计算机硬件及系统信息 程序员技术练级攻略 ThoughtWorks(中国)程序员读书雷达 Sql 分割 键值对字符串 得到某值对应的名称
Ext.net 中日期格式的计算
五蕴非空 · 2013-04-24 · via 博客园 - 五蕴非空

两个DateField控件,分别为开始时间和结束时间。当选择完结束时间后,自动计算这两个时间段所间隔的月或天数。

<ext:DateField runat="server" ID="extdate_start_date" LabelStyle=" text-align:right; " FieldLabel="开始时间" Vtype="daterange">
<CustomConfig>
    <ext:ConfigItem Name="endDateField" Value="#{extdate_end_date}" Mode="Value" />
</CustomConfig>
<Listeners>
      <Change Fn="GetBusiDay" />
</Listeners>
</ext:DateField>
<ext:DateField runat="server" ID="extdate_end_date" LabelStyle=" text-align:right; " FieldLabel="结束时间" Vtype="daterange">
     <CustomConfig>
          <ext:ConfigItem Name="startDateField" Value="#{extdate_start_date}" Mode="Value" />
     </CustomConfig>
      <Listeners>
          <Change Fn="GetBusiDay" />
      </Listeners>
</ext:DateField>

Js代码:

function GetBusiDay() {
            if (extdate_start_date.getValue() == "" || extdate_end_date.getValue() == "")
                return;
            var sday = Ext.util.Format.date(extdate_start_date.getValue(), 'Y/m/d');
            var eday = Ext.util.Format.date(extdate_end_date.getValue(), 'Y/m/d');
            var end = new Date(eday);
            var start = new Date(sday);

            var time = end.getTime() - start.getTime();
            var days = parseInt(time / (1000 * 60 * 60 * 24))+1;
            extnumb_busi_day.setValue(days);
        }

注意一定要转换日期格式 //日期格式为yyyy-mm-dd转换成yyyy/mm/dd