PageSourceSearch

https://www.jtb.co.jp/member/_next/static/chunks/2871-9ccf8b0a2b7c50de.js

js jtb.co.jp collected 2026-09-24 15:30:05 UTC 11,279 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2871],{2871:function(e,n,r){"use strict";r.d(n,{Z:function(){return CommonDatePicker}});var i=r(5165),a=r(7967),s=r(4754),u=r.n(s),o=r(2040),d=r(8557),f=r.n(d),m=r(952),v=r(4400);function CommonDatePicker(e){let{yearInputId:n,monthSelectId:r,daySelectId:s,labelTitle:d,rules:_=[],onChange:p,defaultYear:g="",defaultMonth:D="",defaultDay:x=""}=e,[j,S]=(0,a.useState)([]),[C,Y]=(0,a.useState)(""),[w,N]=(0,a.useState)(!1),[T,B]=(0,a.useState)({year:g,month:D,day:x}),{year:O,month:J,day:b}=T,E=[{...o.HW.mustRequired,message:(0,m.r)("CRMC_CE0001","生年月日")},{...o.HW.halfNumber,message:(0,m.r)("CRMC_BE0032")},{validator:(0,o.VU)("年",4)},{validator:(0,o.Y_)()}];(0,a.useEffect)(()=>{N(C.length>0)},[C]),(0,a.useEffect)(()=>{p&&p(T)},[T]),(0,a.useEffect)(()=>{B({year:g,month:D,day:x})},[g,D,x]),(0,a.useEffect)(()=>{let e=0;O&&J?e=u()(O+J,"YYYYMM").daysInMonth():!O&&J?e=u()(u()().year()+J,"YYYYMM").daysInMonth():J||(e=31),Number.isNaN(e)&&(e=31),parseInt(b)>e&&changeDate("","day"),S(Array.from(Array(e),(e,n)=>n<9?"0".concat(n+1):"".concat(n+1)))},[O,J]);let changeDate=(e,n)=>{"year"==n?(T.year=e,T.day||(T.day="01"),T.month||(T.month="01")):"month"==n?(T.month=e,T.day=Number(T.day)>u()(T.year+T.month,"YYYYMM").daysInMonth()?u()(T.year+T.month,"YYYYMM").daysInMonth().toString():T.day):T.day=e,e?+T.year>new Date().getFullYear()?(Y((0,m.r)("CRMC_BE0024")),N(!0)):1900>+T.year?(Y((0,m.r)("CRMC_BE0025")),N(!0)):"生年月日(西暦)"==d&&u()(new Date).locale("ja")<=u()(T.year+T.month+T.day)?(Y((0,m.r)("CRMC_CE0020")),N(!0)):T.year+T.month+T.day==="19000101"?(Y((0,m.r)("CRMC_BE0024")),N(!0)):(Y(""),N(!1)):(Y((0,m.r)("CRMC_CE0001","生年月日")),N(!0)),B({...T,[n]:e})},validateFormRules=async e=>{B({...T,year:(0,v.dU)(e.target.value)});let n=[...E,..._];for(let r in n){let i=n[r];if(void 0!=i.message){if(i.required&&""===O.trim()||i.pattern&&!e.target.value.match(i.pattern)){Y(i.message);return}}else{let n=!1;if(await i.validator("",e.target.value).then(function(e){},function(e){Y(e),n=!0}),n)return}}if("生年月日(西暦)"==d&&u()(new Date).locale("ja")<=u()(T.year+T.month+T.day)){Y((0,m.r)("CRMC_CE0020"));return}if(T.year+T.month+T.day==="19000101"){Y((0,m.r)("CRMC_BE0024"));return}Y("")};return(0,i.jsxs)("div",{className:"-validate ".concat(w?"-error":""),children:[(0,i.jsxs)("dfn",{className:"JTB-el_heading -errElm -label",children:[d,(0,i.jsx)("button",{className:"JTB-el_tag -required",children:"必須"})]}),(0,i.jsxs)("div",{className:"JTB-el_horizontal__inner -divide JTB-pc-hp_margin-upper-minimum JTB-sp-hp_margin-upper-minimum",children:[(0,i.jsx)("div",{className:"JTB-el_horizontal__item",children:(0,i.jsx)("div",{className:"JTB-el_input -outliner ".concat(w?"-error":"-approved"),children:(0,i.jsx)("input",{className:"JTB-el_input__body -validationYear -validationYearFull",id:n,inputMode:"numeric",placeholder:"1998",value:O,onChange:e=>changeDate((0,v.dU)(e.target.value),"year"),onBlur:async e=>{validateFormRules(e)},maxLength:4})})}),(0,i.jsx)("div",{className:"divider year date"}),(0,i.jsx)("div",{className:"JTB-el_horizontal__item",children:(0,i.jsx)("div",{className:"JTB-el_select",children:(0,i.jsx)("div",{className:"JTB-el_select__inner",children:(0,i.jsxs)("select",{id:r,value:J,required:!0,onChange:e=>changeDate(e.target.value,"month"),className:"JTB-el_select__inform ".concat(f().selectDefault),children:[(0,i.jsx)("option",{value:"",disabled:!0,children:"月"}),(0,i.jsx)("option",{value:"01",children:"01"}),(0,i.jsx)("option",{value:"02",children:"02"}),(0,i.jsx)("option",{value:"03",children:"03"}),(0,i.jsx)("option",{value:"04",children:"04"}),(0,i.jsx)("option",{value:"05",children:"05"}),(0,i.jsx)("option",{value:"06",children:"06"}),(0,i.jsx)("option",{value:"07",children:"07"}),(0,i.jsx)("option",{value:"08",children:"08"}),(0,i.jsx)("option",{value:"09",children:"09"}),(0,i.jsx)("option",{value:"10",children:"10"}),(0,i.jsx)("option",{value:"11",children:"11"}),(0,i.jsx)("option",{value:"12",children:"12"})]})})})}),(0,i.jsx)("div",{className:"divider month date"}),(0,i.jsx)("div",{className:"JTB-el_horizontal__item",children:(0,i.jsx)("div",{className:"JTB-el_select",children:(0,i.jsx)("div",{className:"JTB-el_select__inner",children:(0,i.jsxs)("select",{id:s,value:b,required:!0,onChange:e=>changeDate(e.target.value,"day"),className:"JTB-el_select__inform ".concat(f().selectDefault),children:[(0,i.jsx)("option",{value:"",disabled:!0,children:"日"}),j.map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})})})}),(0,i.jsx)("div",{className:"divider day date"})]}),(0,i.jsx)("em",{className:"JTB-el_input__notice",children:C})]})}},8557:function(e){e.exports={selectDefault:"common-date-picker_selectDefault__qt4pK"}},4754:function(e){var n,r,i,a,s,u,o,d,f,m,v,_,p,g,D,x,j,S,C,Y,w;e.exports=(n="millisecond",r="second",i="minute",a="hour",s="week",u="month",o="quarter",d="year",f="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
1|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p=function(e,n,r){var i=String(e);return!i||i.length>=n?e:""+Array(n+1-i.length).join(r)+e},(D={})[g="en"]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],r=e%100;return"["+e+(n[(r-20)%10]||n[r]||"th")+"]"}},x=function(e){return e instanceof Y},j=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var a=e.toLowerCase();D[a]&&(i=a),n&&(D[a]=n,i=a);var s=e.split("-");if(!i&&s.length>1)return t(s[0])}else{var u=e.name;D[u]=e,i=u}return!r&&i&&(g=i),i||!r&&g},S=function(e,n){if(x(e))return e.clone();var r="object"==typeof n?n:{};return r.date=e,r.args=arguments,new Y(r)},(C={s:p,z:function(e){var n=-e.utcOffset(),r=Math.abs(n);return(n<=0?"+":"-")+p(Math.floor(r/60),2,"0")+":"+p(r%60,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),a=n-i<0,s=e.clone().add(r+(a?-1:1),u);return+(-(r+(n-i)/(a?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return({M:u,y:d,w:s,d:"day",D:f,h:a,m:i,s:r,ms:n,Q:o})[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}}).l=j,C.i=x,C.w=function(e,n){return S(e,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})},w=(Y=function(){function M(e){this.$L=j(e.locale,null,!0),this.parse(e)}var e=M.prototype;return e.parse=function(e){this.$d=function(e){var n=e.date,r=e.utc;if(null===n)return new Date(NaN);if(C.u(n))return new Date;if(n instanceof Date)return new Date(n);if("string"==typeof n&&!/Z$/i.test(n)){var i=n.match(v);if(i){var a=i[2]-1||0,s=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,s)):new Date(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,s)}}return new Date(n)}(e),this.$x=e.x||{},this.init()},e.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},e.$utils=function(){return C},e.isValid=function(){return this.$d.toString()!==m},e.isSame=function(e,n){var r=S(e);return this.startOf(n)<=r&&r<=this.endOf(n)},e.isAfter=function(e,n){return S(e)<this.startOf(n)},e.isBefore=function(e,n){return this.endOf(n)<S(e)},e.$g=function(e,n,r){return C.u(e)?this[n]:this.set(r,e)},e.unix=function(){return Math.floor(this.valueOf()/1e3)},e.valueOf=function(){return this.$d.getTime()},e.startOf=function(e,n){var o=this,m=!!C.u(n)||n,v=C.p(e),l=function(e,n){var r=C.w(o.$u?Date.UTC(o.$y,n,e):new Date(o.$y,n,e),o);return m?r:r.endOf("day")},$=function(e,n){return C.w(o.toDate()[e].apply(o.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(n)),o)},_=this.$W,p=this.$M,g=this.$D,D="set"+(this.$u?"UTC":"");switch(v){case d:return m?l(1,0):l(31,11);case u:return m?l(1,p):l(0,p+1);case s:var x=this.$locale().weekStart||0,j=(_<x?_+7:_)-x;return l(m?g-j:g+(6-j),p);case"day":case f:return $(D+"Hours",0);case a:return $(D+"Minutes",1);case i:return $(D+"Seconds",2);case r:return $(D+"Milliseconds",3);default:return this.clone()}},e.endOf=function(e){return this.startOf(e,!1)},e.$set=function(e,s){var o,m=C.p(e),v="set"+(this.$u?"UTC":""),_=((o={}).day=v+"Date",o[f]=v+"Date",o[u]=v+"Month",o[d]=v+"FullYear",o[a]=v+"Hours",o[i]=v+"Minutes",o[r]=v+"Seconds",o[n]=v+"Milliseconds",o)[m],p="day"===m?this.$D+(s-this.$W):s;if(m===u||m===d){var g=this.clone().set(f,1);g.$d[_](p),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else _&&this.$d[_](p);return this.init(),this},e.set=function(e,n){return this.clone().$set(e,n)},e.get=function(e){return this[C.p(e)]()},e.add=function(e,n){var o,f=this;e=Number(e);var m=C.p(n),y=function(n){var r=S(f);return C.w(r.date(r.date()+Math.round(n*e)),f)};if(m===u)return this.set(u,this.$M+e);if(m===d)return this.set(d,this.$y+e);if("day"===m)return y(1);if(m===s)return y(7);var v=((o={})[i]=6e4,o[a]=36e5,o[r]=1e3,o)[m]||1,_=this.$d.getTime()+e*v;return C.w(_,this)},e.subtract=function(e,n){return this.add(-1*e,n)},e.format=function(e){var n=this,r=this.$locale();if(!this.isValid())return r.invalidDate||m;var i=e||"YYYY-MM-DDTHH:mm:ssZ",a=C.z(this),s=this.$H,u=this.$m,o=this.$M,d=r.weekdays,f=r.months,h=function(e,r,a,s){return e&&(e[r]||e(n,i))||a[r].slice(0,s)},c=function(e){return C.s(s%12||12,e,"0")},v=r.meridiem||function(e,n,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i}
1,p={YY:String(this.$y).slice(-2),YYYY:C.s(this.$y,4,"0"),M:o+1,MM:C.s(o+1,2,"0"),MMM:h(r.monthsShort,o,f,3),MMMM:h(f,o),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:h(r.weekdaysMin,this.$W,d,2),ddd:h(r.weekdaysShort,this.$W,d,3),dddd:d[this.$W],H:String(s),HH:C.s(s,2,"0"),h:c(1),hh:c(2),a:v(s,u,!0),A:v(s,u,!1),m:String(u),mm:C.s(u,2,"0"),s:String(this.$s),ss:C.s(this.$s,2,"0"),SSS:C.s(this.$ms,3,"0"),Z:a};return i.replace(_,function(e,n){return n||p[e]||a.replace(":","")})},e.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},e.diff=function(e,n,f){var m,v=C.p(n),_=S(e),p=(_.utcOffset()-this.utcOffset())*6e4,g=this-_,D=C.m(this,_);return D=((m={})[d]=D/12,m[u]=D,m[o]=D/3,m[s]=(g-p)/6048e5,m.day=(g-p)/864e5,m[a]=g/36e5,m[i]=g/6e4,m[r]=g/1e3,m)[v]||g,f?D:C.a(D)},e.daysInMonth=function(){return this.endOf(u).$D},e.$locale=function(){return D[this.$L]},e.locale=function(e,n){if(!e)return this.$L;var r=this.clone(),i=j(e,n,!0);return i&&(r.$L=i),r},e.clone=function(){return C.w(this.$d,this)},e.toDate=function(){return new Date(this.valueOf())},e.toJSON=function(){return this.isValid()?this.toISOString():null},e.toISOString=function(){return this.$d.toISOString()},e.toString=function(){return this.$d.toUTCString()},M}()).prototype,S.prototype=w,[["$ms",n],["$s",r],["$m",i],["$H",a],["$W","day"],["$M",u],["$y",d],["$D",f]].forEach(function(e){w[e[1]]=function(n){return this.$g(n,e[0],e[1])}}),S.extend=function(e,n){return e.$i||(e(n,Y,S),e.$i=!0),S},S.locale=j,S.isDayjs=x,S.unix=function(e){return S(1e3*e)},S.en=D[g],S.Ls=D,S.p={},S)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.