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

推荐订阅源

L
LINUX DO - 最新话题
G
Google Developers Blog
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
F
Full Disclosure
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
Help Net Security
Help Net Security
The Hacker News
The Hacker News
IT之家
IT之家
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
V
Visual Studio Blog
博客园 - 聂微东
Hacker News: Ask HN
Hacker News: Ask HN
H
Hacker News: Front Page
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Security Archives - TechRepublic
Security Archives - TechRepublic
Simon Willison's Weblog
Simon Willison's Weblog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Last Week in AI
Last Week in AI
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
Google DeepMind News
Google DeepMind News
Cloudbric
Cloudbric
N
News | PayPal Newsroom
A
About on SuperTechFans
S
Schneier on Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
雷峰网
雷峰网
T
The Exploit Database - CXSecurity.com
罗磊的独立博客
K
Kaspersky official blog
The Cloudflare Blog
I
Intezer

博客园 - 五蕴非空

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