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

推荐订阅源

IT之家
IT之家
C
CXSECURITY Database RSS Feed - CXSecurity.com
V
Visual Studio Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
小众软件
小众软件
L
LangChain Blog
Cyberwarzone
Cyberwarzone
美团技术团队
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
V
V2EX
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
aimingoo的专栏
aimingoo的专栏
人人都是产品经理
人人都是产品经理
F
Full Disclosure
V2EX - 技术
V2EX - 技术
The Cloudflare Blog
博客园 - 叶小钗
T
Threat Research - Cisco Blogs
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Latest news
Latest news
S
Security @ Cisco Blogs
Spread Privacy
Spread Privacy
Project Zero
Project Zero
K
Kaspersky official blog
MyScale Blog
MyScale Blog
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Webroot Blog
Webroot Blog
罗磊的独立博客
Vercel News
Vercel News
N
News and Events Feed by Topic
A
Arctic Wolf
C
CERT Recently Published Vulnerability Notes

博客园 - 五蕴非空

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