求一个年月 的日期控件。 js 脚本的最好 。 谢谢

假牙 2009-11-13 12:28:22
求一个年月 的日期控件。 js 脚本的最好 。 谢谢
...全文
296 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
JadeDaydayup 2011-06-17
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 luoanjade 的回复:]
<script language="JavaScript" type="text/javascript">
today=new Date();
year=today.getYear();
month=today.getMonth()+1;
day=today.getDate();
if (year < 2000) year += 1900;
document.w……
[/Quote]
把这个做成用户自定义控件,然后可以随意调用。也是一个很好的选择呀!!!
flyerwing 2011-06-17
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 z307755214 的回复:]
推荐这个:My97DatePicker
[/Quote]
好象还有个梅花雨什么的,多了去了找个就好了,不过浏览器全兼容的挺少.
JadeDaydayup 2011-06-17
  • 打赏
  • 举报
回复
这应该是最基本的脚本了!!!
JadeDaydayup 2011-06-17
  • 打赏
  • 举报
回复
<script language="JavaScript" type="text/javascript">
today=new Date();
year=today.getYear();
month=today.getMonth()+1;
day=today.getDate();
if (year < 2000) year += 1900;
document.write(year+"年"+month+"月"+day+"日星期");
today=new Date();
dayofweek=today.getDay();
Day=new Array(7);
Day[0]="日"; Day[1]="一";
Day[2]="二"; Day[3]="三";
Day[4]="四"; Day[5]="五";
Day[6]="六";
document.write(Day[dayofweek]);
</script>
wanglihong911008 2011-06-17
  • 打赏
  • 举报
回复
求一个年月 的日期控件
wuyq11 2009-11-13
  • 打赏
  • 举报
回复
My97DatePicker
碎片球球 2009-11-13
  • 打赏
  • 举报
回复
好像Windows有一个吧
cailee 2009-11-13
  • 打赏
  • 举报
回复
my97?
zhangguifeng123 2009-11-13
  • 打赏
  • 举报
回复
zhangguifeng123 2009-11-13
  • 打赏
  • 举报
回复
http://www.ijavascript.cn
雷肿么了 2009-11-13
  • 打赏
  • 举报
回复
推荐这个:My97DatePicker
limii 2009-11-13
  • 打赏
  • 举报
回复
up
ivws_19 2009-11-13
  • 打赏
  • 举报
回复
游_子 2009-11-13
  • 打赏
  • 举报
回复
注:此为旧版,我另上传有最新版,见http://download.csdn.net/source/1802967。 功能强大的JavaScript日历控件 最关键的,无偿的永久的提供给大家免费使用,含全部源代码。 功能简介: 一、更人性化,更全面的功能 大部分日期控件都具备这些功能,但是本日历控件做的更全面,更人性化,并且速度一流. 支持多种调用模式 除支持常规在input单击调用外,还支持使用其他的元素如:<img><div>触发WdatePicker函数来调用弹出日期框 支持周显示 可以通过配置isShowWeek属性决定是否限制周,并且在返回日期的时候还可以通过自带的自定义事件和API函数返回选择的周 只读开关,高亮周末功能 设置readOnly属性 true 或 false 可指定日期框是否只读;设置highLineWeekDay属性 ture 或 false 可指定是否高亮周末 操作按钮自定义 清空按钮和今天按钮,可以根据需要进行自定义,它们分别对应 isShowClear 和 isShowToday 默认值都是true 支持多种容器 除了可以将值返回给input以外,还可以通过配置el属性将值返回给其他的元素(如:textarea,div,span)等,带有innerHTML属性的HTML元素 起始日期功能 有时在项目中需要选择生日之类的日期,而默认点开始日期都是当前日期,导致份选择非常麻烦,你可以通过起始日期功能加上配置alwaysUseStartDate属性轻松解决此类问题 自定义格式(注意大小写) yMdHmswW分别代表日时分秒星期周,你可以任意组合这些元素来自定义你个性化的日期格式. 如:"yyyyMd日 HH时mm分" 返回:"2008312日 19时20分" 编辑功能 不知道您是否已经注意到,当日期框里面有值时,右下角的按钮会变成更新,修改完某个属性后,只要点击这个按钮就可以实现时间和日期的编辑 下拉,输入,导航选择日期 时分秒输入框都具备以下3个属性:通过导航图标选择,直接使用键盘输入数字,直接从弹出的下拉框中选择.因此不管你选择什么样的日期和时间都可以找到一种最快捷的方法,用最少的鼠标点击来搞定 自动纠错功能 纠错处理可设置为3种模式 1.提示 2.自动纠错(默认) 3.标记 当日期框中的值不符合格式时,系统会尝试自动修复,如果修复失败会根据您设置的纠错处理模式进行处理,错误判断功能非常智能它可以保证用户输入的值是一个合法的值 为编程带来方便 如果el的值是this,可省略,即所有的el:this都可以不写 日期框设置为disabled时,禁止更改日期(不弹出选择框) 如果没有定义onpicked事件,自动触发文本框的onchange事件 如果没有定义oncleared事件,清空时,自动触发onchange事件 其他属性设置 readOnly属性,可指定日期框是否只读 设置highLineWeekDay属性,可指定是否高亮周末 设置isShowOthers属性,可指定是否显示其他日期 加上class="Wdate"就会在选择框右边出现日期图标 二、强大的日期范围限制功能 支持静态限制,动态限制,脚本自定义限制,以及无效天和无效日期功能,利用这样功能你可以任意定制不能选择的日期,这些日期即使毫无规律,毫无连续性,你也可以通过这些功能的组合使用轻松搞定. 静态限制 你可以给通过配置minDate(最小日期),maxDate(最大日期)为静态日期值,来限定日期的范围 无效天可以使用此功能禁用周日至周六所对应的日期,相关属性:disabledDays (0至6 分别代表 周日至周六) 动态限制 你可以通过系统给出的动态变量,如%y(当前),%M(当前)等来限度日期范围,你还可以通过#{}进行表达式运算,如:#{%d+1}:表示明天 无效日期可以使用此功能禁用,所指定的一个或多个日期,只要你熟悉正则表达式,你可以尽情发挥 脚本自定义限制 系统提供了$dp.$D和$dp.$DV这两个API来辅助你进行日期运算,此外你还可以通过在 #F{} 中填入你自定义的脚本,做任何你想做的日期限制 三、自定义事件和丰富的API库 如果你需要做一些附加的操作,你也不必担心,日期控件自带的自定义事件可以满足你的需.此外,你还可以在自定义事件中调用提供的API库来做更多的运算和扩展,绝对可以通过很少的代码满足你及其个性化的需. 四、多语言支持和自定义皮肤支持 通过lang属性,可以为每个日期控件单独配置语言,当然也可以通过WdatePicker.js配置全局的语言,皮肤也是一样,只要配置skin属性即可.这样一个页面中可以显示
Properties Following the first object, the class also accepts an optional second object that may contain any of the following properties to help customize Calendar to your website: * blocked - An array of blocked (disabled) dates in the following format: 'day month year'. The syntax is similar to cron: the values are separated by spaces and may contain * (asterisk) - (dash) and , (comma) delimiters. For example blocked: ['1 1 2007'] would disable January 1, 2007; blocked: ['* 1 2007'] would disable all days (wildcard) in January, 2007; blocked: ['1-10 1 2007'] would disable January 1 through 10, 2007; while blocked: ['1,10 1 2007'] would disable January 1 and 10, 2007. In combination: blocked: ['1-10,20,22,24 1-3 *'] would disable 1 through 10, plus the 22nd and 24th of January through March for every (wildcard) year. There is an optional additional value which is day of the week (0 - 6 with 0 being Sunday). For example blocked: ['0 * 2007 0,6'] would disable all weekends (saturdays and sundays) in 2007. * classes - An array of 12 CSS classes that are applied to the calendar construct: calendar, prev, next, month, year, today, invalid, valid, inactive, active, hover, hilite. It is not necessary (as of RC3) to pass all 11 classes in the array: if you only wanted to change the 1st class you would set classes: ['alternate']; if you only wanted to change the 1st and 4th classes you would need to set classes: ['alternate', '', '', 'mes']. The first class, by default 'calendar', is applied to the div that contains the calendar element, the calendar button and the input or select it is appended to. The 'hilite' class (as of RC4) is applied to all days between 2 or more selected dates in multi-calendar functionality - see the demo for an example. * days - An array of the 7 names of the days of the week, starting with sunday. * direction - A positive or negative integer that determines the calendar's direction: n (a positive number) the calendar is future-only beginning at n days after today; -n (a negative number) the calendar is past-only ending at n days before today; 0 (zero) the calendar has no future or past restrictions (default). Note if you would like the calendar to be directional starting from today–as opposed to (1) tomorrow or (-1) yesterday–use a positive or negative fraction, such as direction: .5 (future-only, starting today). * draggable - A boolean value, true or false, to indicate if the calendar element will be draggable–useful in case the calendar obstructs (or is obstructed by) some other element on the page. Note, requires Mootools to be compiled with the Drag component. * months - An array of the 12 names of the month, starting with january. * navigation - An integer–0, 1 or 2–indicating which navigation method the class will use: traditional navigation (1) where left and right arrows allow the user to navigate by month (default); improved navigation (2) where the user can navigate by month or year; and static navigation (0) which is actually no navigation at all. * offset - An integer that indicates the first day of the week, with 0 being Sunday (default). * onHideStart, onHideComplete, onShowStart, onShowComplete - Event handlers that can be used to trigger your own scripts. * pad - An integer, the minimum number of days between calendars with multi-calendar functionality. For example: 1 (default) would enforce multiple calendars to space at least 1 day between picked dates; 7 would enforce a space of at least 1 week; while 0 (no padding) would allow multiple calendars to occupy the same date. * tweak - An object with { x: 0, y: 0} values that will "tweak" the calendar's placement on the page by x number of pixels horizontally and y number of pixels vertically. //参数说明 //日期格式字符(d, D, j, l, N, w, S, F, m, M, n, Y, y)分别对应(01, Mon, 01, Mon, 2, 2, st, 2, 02, 2, 02, 2010, 10) //blocked:禁止选择的日期。blocked: ['日 周(可选)'],blocked: ['3 * *']:表示禁止选择所有份的所有份的3号,blocked: ['1-10 3 2010']:表示禁止选择201031日到10日的日期,blocked: ['1,10 3 2010']:表示禁止选择20103的1日和10日,blocked: ['1-10,20,22,24 1-3 *']:表示禁止所有所份的1到3份的1到10日,20日,22日,24日的日期,blocked: ['0 * 2010 0,6']:表示禁止选择2010所有份的周六和周日 //classes:3种风格样式,calendar,dashboard,i-heart-ny,默认为calendar //days:定义星期显示的文字,默认为英文。days: ['日','一','二','三','四','五','六'] //direction:可选择日期的方向。0:表示不限制,负数:表示只可选当前日期的前负数值天的日期,正数表示只可选当前日期的前(正数值-1)天的日期 //draggable:是否可拖动,值为true和false,默认为true //months:定义份显示的文字,默认为英文。months:['1','2','3','4','5','6','7','8','9','10','11','12'] //navigation:的导航。0:表示没有导航,1:有导航按钮(默认值),2:有导航按钮 //offset:指示一周的第一天是星期几,默认为0,指星期天 //onHideStart, onHideComplete, onShowStart, onShowComplete:事件,可用于触发您自己的脚本处理程序 //pad:多日历显示,参考官网:http://www.electricprism.com/aeron/calendar/ //tweak:日历控件的相对座标
再次声明 千万不要把XiaoQi.dll 跟 XiaoQi.XML 给分开 201338号 修复了很多bug 调整了源代码 添加的时候 一定要引用 不要直接复制DLL 不然没有方法注释 最强大分分页控件 华丽的分页控件 实用的分页控件 有最新最实用的方法 联系小柒 下面是 AspNetHelp 类 方法概述 ///Show()弹出对话框 ///重载Show()弹出对话框 并且跳转界面 ///ShowJavascript()执行javascript脚本 ///FileDelete()给出文件虚拟路径删除文件 ///FileSize()获取上传文件大小 ///FileUpload()文件上传 路径upload/ 自动重命名 ///FileDownload()文件下载 调用方法如 FileDownload(Response,Server,文件虚拟路径) ///FileTxtWrite()写入TXT文本 给出要创建Txt 文本的地址 ///FileTxtReader()读取TXT文本 Txt 文本的地址 返回一个数组 每一行为数组里的一个元素 ///StringEncrypt() DES字符串加密中文不可以加密 ///StringDecrypt()DES解密字符串 ///StringMD5Encrypt()MD5加密 ///StringPYChar()单个汉字返回该汉字首字母 ///StringRandom()生成指定位数的随机数 ///StringEdit()给出指定字符串长度多少位后用点显示... ///StringReplaceSpace()替换文本中的空格和换行 ///StringColor()改变字的颜色 ///StringNull()当对象是空的时候 转为空字符串 ///StringConvert()汉字转拼音 ///StringNumber()数字转换中文 ///StringRep()url参数为中文时候转换加密 ///StringRes()url参数为中文时候转换解密 ///ShowWindowForm()弹出新窗口页面 ///ShowFormModalDialog()弹出模式窗口页面 ///SqlGetMaxID()给出表名列名 int类型 查询出最大列值+1 适用于主键 ///SqlGetSingle()执行一条计算查询结果语句,返回查询结果(object)。 ///SqlExecute()执行SQL语句,返回影响的记录数 ///SqlRunStr()执行SQL语句,不返回影响的记录数 ///SqlRunReturn()执行SQL语句,并返回第一行第一列结果 ///SqlGetReader()获得SqlDataReader对象 使用完须关闭DataReader,关闭数据库连接 ///SqlGetTable()执行查询语句,返回DataTable ///SqlDataSet()执行查询语句,返回DataSet ///SqlIsCunZai()执行Sql 语句查询是否有数据 如果没有返回假 ///SqlRunProc()执行存储过程 ///DataBindDropDownListDefault()DropDownList控件绑定 带默认选择项 如"请选择" ///DataBindDropDownList()DropDownList控件绑定 不带默认选择项 ///DataBindRadioButtonList()RadioButtonList控件绑定 默认第一个选中 ///DataBindCheckBoxList()CheckBoxList控件绑定 ///ElseIpAddr()调用此方法 返回当前登录的省市IP地址 ///ElseDataTimeIng()返回本地电脑的当前日期日时分秒 动态的显示 JS实现 ///ElsePageLoad()页面加载数据加载完成呈现页面 ///ElseCkeck()返回页面验证码图片 使用方法:单独创建一个页面 在首次加载事件里写 AspNetHelp.ElseCkeck(Page); 在使用验证码的页面直接写 img src="这个页面的路径" 注意验证码保存在 Session["CheckCode"]中 这里是区分大小写的 ///ElseColorRGB()由于QQ截图的取色会出现RGB的颜色 这里能转换成16进制 分页控件详情请看内置文档

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧