晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/akaindir/www/crm/libraries/jquery/gantt/libs/dateField/ |
Upload File : |
/*
Copyright (c) 2009 Open Lab
Written by Roberto Bicchierai http://roberto.open-lab.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
jQuery.fn.dateField = function(options) {
//check if the input field is passed correctly
if (!options.inputField){
console.error("You must supply an input field");
return false;
}
// -------------------------- start default option values --------------------------
if (typeof(options.firstDayOfWeek) == "undefined")
options.firstDayOfWeek=Date.firstDayOfWeek;
if (typeof(options.useWheel) == "undefined")
options.useWheel=true;
if (typeof(options.dateFormat) == "undefined")
options.dateFormat=Date.defaultFormat;
// -------------------------- end default option values --------------------------
// ------------------ start
if(options.inputField.is("[readonly]") || options.inputField.is("[disabled]"))
return;
var calendar = {currentDate: new Date()};
calendar.options = options;
//build the calendar on the first element in the set of matched elements.
var theOpener = this.eq(0);
var theDiv=$("<div>").addClass("calBox");
//create calendar elements elements
var divNavBar = $("<div>").addClass("calNavBar");
var divDays = $("<div>").addClass("calDay");
divDays.addClass("calFullMonth");
theDiv.append(divNavBar).append(divDays);
if (options.isSearchField){
var divShortcuts=$("<div>").addClass("shortCuts").html("<span title='last quarter'>LQ</span> <span title='last month'>LM</span> <span title='this month'>M</span> <span title='last week'>LW</span> <span title='this week'>W</span> <span title='yesterday'>Y</span> <span title='today'>T</span><span title='tomorrow'>TO</span> <span title='next week'>NW</span> <span title='next month'>NM</span> <span title='this quarter'>Q</span> <span title='next quarter'>NQ</span>");
divShortcuts.click(function(ev){
var el=$(ev.target);
if(el.is("span")){
if (!options.isSearchField)
options.inputField.val(Date.parseString(el.text().trim(),options.dateFormat).format(options.dateFormat),true);
else
options.inputField.val(el.text().trim());
theDiv.remove();
}
});
theDiv.append(divShortcuts);
}
$("body").append(theDiv);
nearBestPosition(theOpener,theDiv);
theDiv.bringToFront();
//register for click outside. Delayed to avoid it run immediately
$("body").oneTime(100, "regclibodcal", function() {
$("body").bind("click.dateField", function() {
$(this).unbind("click.dateField");
theDiv.remove();
});
});
calendar.drawCalendar = function(date) {
calendar.currentDate = date;
var fillNavBar = function(date) {
var t = new Date(date.getTime());
divNavBar.empty();
t.setMonth(t.getMonth()-1);
var spanPrev = $("<span>").addClass("calElement noCallback prev").attr("millis", t.getTime());
t.setMonth(t.getMonth()+1);
var spanMonth = $("<span>").html(t.format("MMMM yyyy"));
t.setMonth(t.getMonth()+1);
var spanNext = $("<span>").addClass("calElement noCallback next").attr("millis", t.getTime());
divNavBar.append(spanPrev).append(spanMonth).append(spanNext);
};
var fillDaysFullMonth = function(date) {
divDays.empty();
var t = new Date();//today
var w = parseInt((theDiv.width()-4-(4*7))/7)+"px";
// draw day headers
var d = new Date(date);
d.setFirstDayOfThisWeek(options.firstDayOfWeek);
for (var i = 0; i < 7; i++) {
var span = $("<span>").addClass("calDayHeader").attr("day", d.getDay());
span.css("width",w);
span.html(Date.dayAbbreviations[d.getDay()]);
//call the dayHeaderRenderer
if (typeof(options.dayHeaderRenderer) == "function")
options.dayHeaderRenderer(span,d.getDay());
divDays.append(span);
d.setDate(d.getDate()+1);
}
//draw cells
d = new Date(date);
d.setDate(1); // set day to start of month
d.setFirstDayOfThisWeek(options.firstDayOfWeek);//go to first day of week
var i=0;
while ((d.getMonth()<=date.getMonth() && d.getFullYear()<=date.getFullYear()) || d.getFullYear()<date.getFullYear() || (i%7!=0)) {
var span = $("<span>").addClass("calElement day").attr("millis", d.getTime());
span.html("<span class=dayNumber>" + d.getDate() + "</span>").css("width",w);
if (d.getYear() == t.getYear() && d.getMonth() == t.getMonth() && d.getDate() == t.getDate())
span.addClass("today");
if (d.getYear() == date.getYear() && d.getMonth() == date.getMonth() && d.getDate() == date.getDate())
span.addClass("selected");
if(d.getMonth()!=date.getMonth())
span.addClass("calOutOfScope");
//call the dayRenderer
if (typeof(options.dayRenderer) == "function")
options.dayRenderer(span,d);
divDays.append(span);
d.setDate(d.getDate()+1);
i++;
}
};
fillNavBar(date);
fillDaysFullMonth(date);
};
theDiv.click(function(ev) {
var el = $(ev.target).closest(".calElement");
if (el.size() > 0) {
var date = new Date(parseInt(el.attr("millis")));
if (el.hasClass("day")) {
theDiv.remove();
if (!el.is(".noCallback")) {
options.inputField.val(date.format(options.dateFormat)).attr("millis", date.getTime()).focus();
if (typeof(options.callback) == "function")
options.callback(date);
}
} else {
calendar.drawCalendar(date);
}
}
ev.stopPropagation();
});
//if mousewheel
if ($.event.special.mousewheel && options.useWheel) {
divDays.mousewheel(function(event, delta) {
var d = new Date(calendar.currentDate.getTime());
d.setMonth(d.getMonth() + delta);
calendar.drawCalendar(d);
return false;
});
}
// start calendar to the date in the input
var dateStr=options.inputField.val();
if (!dateStr || !Date.isValid(dateStr,options.dateFormat,true)){
calendar.drawCalendar(new Date());
} else {
var date = Date.parseString(dateStr,options.dateFormat,true);
//set date string formatted
if (!options.isSearchField)
options.inputField.val(date.format(options.dateFormat)).attr("millis",date.getTime());
calendar.drawCalendar(date);
}
return calendar;
};